Skip to content

Commit

Permalink
Fix error in utils
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Escribano <[email protected]>
  • Loading branch information
carlosescri committed Oct 18, 2017
1 parent 6196d93 commit 06c444f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Version 5.
----------

v5.6.2
======
- Fixed bug reading error response details.

v5.6.1
======
* New features
Expand Down
6 changes: 3 additions & 3 deletions src/Management/Errors/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public static function handleErrors($statusCode, $response) {

private static function readError($response) {
$error = json_decode($response, true);
$error = $error['detail'];

if (!isset($error)) {
if (is_null($error) || !isset($error['detail'])) {
$error = $response;
} else {
$error = $error['detail'];
}

return $error;
Expand Down

0 comments on commit 06c444f

Please sign in to comment.