Skip to content

Commit

Permalink
Error reporting refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
igusar-epam committed Dec 9, 2019
1 parent 5f86e5d commit 225462e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hyperwallet/Util/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private function doRequest($method, $url, array $urlParams, array $options) {
throw new HyperwalletApiException($errorResponse, $e);
} catch (BadResponseException $e) {
$body = \GuzzleHttp\json_decode($e->getResponse()->getBody(), true);
if (is_null($body) || !$body->errors || empty($body->errors)) {
if (is_null($body) || !isset($body['errors']) || empty($body['errors'])) {
$body = array('errors' => array(
array(
'message' => 'Failed to get any error message from response',
Expand Down

0 comments on commit 225462e

Please sign in to comment.