diff --git a/src/FreshMail/Client.php b/src/FreshMail/Client.php index 372eea7..e8b4f78 100644 --- a/src/FreshMail/Client.php +++ b/src/FreshMail/Client.php @@ -74,7 +74,10 @@ public function doRequest(string $uri, array $params = []) throw new UnauthorizedException('Request unauthorized'); } - throw new \FreshMail\ApiV2\ClientException(sprintf('Connection error, error message: '.$exception->getMessage())); + throw new \FreshMail\ApiV2\ClientException(sprintf( + 'Connection error, error message: %s', + $exception->getResponse()->getBody()->getContents() + )); } catch (\GuzzleHttp\Exception\ConnectException $exception) { throw new ConnectionException(sprintf('Connection error, error message: '.$exception->getMessage())); }