From 225462eea684736d34ed9a837acf52631ef79394 Mon Sep 17 00:00:00 2001 From: Ievgen Gusar Date: Mon, 9 Dec 2019 18:49:23 +0200 Subject: [PATCH] Error reporting refactoring. --- src/Hyperwallet/Util/ApiClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hyperwallet/Util/ApiClient.php b/src/Hyperwallet/Util/ApiClient.php index 8753d7f5..a21cbc35 100644 --- a/src/Hyperwallet/Util/ApiClient.php +++ b/src/Hyperwallet/Util/ApiClient.php @@ -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',