From 78886a85e92749f3f37ed7f3b40dce67940cc633 Mon Sep 17 00:00:00 2001 From: "mikolaj.kania" Date: Mon, 18 Jan 2021 09:33:28 +0100 Subject: [PATCH] Get rid off truncated error messages --- src/FreshMail/Client.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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())); }