Skip to content

Commit

Permalink
Do not populate json field with a object
Browse files Browse the repository at this point in the history
  • Loading branch information
frantisek.sichinger committed Dec 14, 2018
1 parent 47bfb2a commit 4195dc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/JsonBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ public function send(Request $r)
} catch (ClientException $e) {
if ($e->hasResponse()) {
$response = new Response($e->getResponse()->getBody());
$response->json = json_decode($e->getResponse()->getBody());
$response->json = json_decode($e->getResponse()->getBody(), true);
$response->statusCode = $e->getCode();
$this->logger->logHttpCommunication($r, $response);
return $response;
}
} catch (\Exception $ex) {
$response = new Response($ex->getMessage());
$response->statusCode = 500;
$response->json = json_decode("{}", true);
$this->logger->logHttpCommunication($r, $response);
return $response;
}
Expand Down

0 comments on commit 4195dc2

Please sign in to comment.