diff --git a/src/Connection/HTTPlugConnection.php b/src/Connection/HTTPlugConnection.php index d7bddfb..15be6b9 100644 --- a/src/Connection/HTTPlugConnection.php +++ b/src/Connection/HTTPlugConnection.php @@ -62,7 +62,7 @@ public function call(string $method, array $params = array(), string $requestMet } catch (ApiException $e) { throw $e; } catch (\Exception $e) { - throw new ApiException('Technical error occurred.', 500); + throw new ApiException('Technical error occurred.', 500, $e); } } @@ -84,7 +84,7 @@ private function parseResponse(ResponseInterface $response): array } if (static::NOT_FOUND_MESSAGE === $content) { - throw new NotFoundException(); + throw new NotFoundException('Server did not find any entity for the request.'); } throw new ApiException($content, $response->getStatusCode()); diff --git a/src/Exception/ApiException.php b/src/Exception/ApiException.php index 0b3bb55..bd0323b 100644 --- a/src/Exception/ApiException.php +++ b/src/Exception/ApiException.php @@ -11,17 +11,6 @@ final class ApiException extends \Exception { - /** - * ApiException constructor. - * - * @param string $message - * @param int $code - */ - public function __construct(string $message, int $code = 0) - { - parent::__construct($message, $code); - } - /** * {@inheritdoc} */