1<?php
2
3namespace MatrixPhp\Exceptions;
4
5/**
6 * The library used for http requests raised an exception.
7 *
8 * @package MatrixPhp\Exceptions
9 */
10class MatrixHttpLibException extends MatrixException {
11
12    public function __construct(\Exception $originalException, string $method, string $endpoint) {
13        $msg = sprintf(
14            'Something went wrong in %s requesting %s: %s',
15            $method,
16            $endpoint,
17            $originalException->getMessage(),
18        );
19        parent::__construct($msg, $originalException->getCode(), $originalException);
20    }
21}
22