Skip to content

Commit 9c83728

Browse files
Merge pull request #16 from kaniosx/master
TICKETS-9701 Get rid off truncated error messages
2 parents 053b7ec + 78886a8 commit 9c83728

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/FreshMail/Client.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ public function doRequest(string $uri, array $params = [])
7474
throw new UnauthorizedException('Request unauthorized');
7575
}
7676

77-
throw new \FreshMail\ApiV2\ClientException(sprintf('Connection error, error message: '.$exception->getMessage()));
77+
throw new \FreshMail\ApiV2\ClientException(sprintf(
78+
'Connection error, error message: %s',
79+
$exception->getResponse()->getBody()->getContents()
80+
));
7881
} catch (\GuzzleHttp\Exception\ConnectException $exception) {
7982
throw new ConnectionException(sprintf('Connection error, error message: '.$exception->getMessage()));
8083
}

0 commit comments

Comments
 (0)