Skip to content

Commit

Permalink
Allows nested error responses to be shown to the user.
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonius committed Aug 14, 2018
1 parent 457fd5b commit 7982de6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/CloudApi/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ public function processResponse(ResponseInterface $response)
if (property_exists($object, '_embedded') && property_exists($object->_embedded, 'items')) {
$return = $object->_embedded->items;
} elseif (property_exists($object, 'error')) {
throw new \Exception($object->message);
foreach ($object->message as $message) {
$output .= $message;
}
throw new \Exception($output);
} else {
$return = $object;
}
Expand Down

0 comments on commit 7982de6

Please sign in to comment.