Skip to content
Snippets Groups Projects
Commit 4d4153c1 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Display exception message even if non-JSON.

parent 23161f5a
No related merge requests found
...@@ -141,7 +141,9 @@ class Connector extends Base implements LoggerAwareInterface ...@@ -141,7 +141,9 @@ class Connector extends Base implements LoggerAwareInterface
$this->client->setEncType($messageFormat); $this->client->setEncType($messageFormat);
$result = $this->client->send(); $result = $this->client->send();
if (!$result->isSuccess()) { if (!$result->isSuccess()) {
throw new ApiException(json_decode($result->getBody(), true)); $error = $result->getBody();
$decodedError = json_decode($error, true);
throw new ApiException($decodedError ? $decodedError : $error);
} }
return $result->getBody(); return $result->getBody();
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment