Skip to content

Commit d82e93c

Browse files
author
Ivan Russkykh
committed
[BOODMO-17571] Process json_decode error
1 parent db40f4b commit d82e93c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function processResult(ResponseInterface $response): object
9494
try {
9595
$responseObject = \GuzzleHttp\json_decode($response->getBody());
9696
} catch (\Exception $exception) {
97-
throw new ApiErrorException($exception->getMessage());
97+
throw new ApiErrorException("Internal API server error: " . preg_replace( "/\r|\n|\r\n/", "", $response->getBody()), 503);
9898
}
9999

100100
if ($responseObject->meta->status !== self::CLICKPOST_STATUS_CODE_200 && $responseObject->meta->message != 'Success') {

0 commit comments

Comments
 (0)