| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class ErrorResponseException extends \Exception implements JsonRpcClientExceptionInterface |
||
| 19 | { |
||
| 20 | private ErrorObject $error; |
||
| 21 | |||
| 22 | public function __construct(ErrorObject $error) |
||
| 23 | 9 | { |
|
| 24 | $this->error = $error; |
||
| 25 | 9 | ||
| 26 | parent::__construct( |
||
| 27 | 9 | sprintf( |
|
| 28 | 9 | 'Server response has error: code %d, message "%s", data %s.', |
|
| 29 | 9 | $error->getCode(), |
|
| 30 | 9 | $error->getMessage(), |
|
| 31 | 9 | json_encode($error->getData()) |
|
| 32 | 9 | ) |
|
| 33 | ); |
||
| 34 | } |
||
| 35 | 9 | ||
| 36 | public function getError(): ErrorObject |
||
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |