src/Adapters/GuzzleAdapter.php 1 location
|
@@ 136-142 (lines=7) @@
|
| 133 |
|
/** |
| 134 |
|
* @throws HttpException |
| 135 |
|
*/ |
| 136 |
|
protected function handleError() |
| 137 |
|
{ |
| 138 |
|
$body = (string) $this->response->getBody(true); |
| 139 |
|
$code = (int) $this->response->getStatusCode(); |
| 140 |
|
$content = json_decode($body); |
| 141 |
|
throw new HttpException(isset($content->message) ? $content->message : 'Request not processed.', $code); |
| 142 |
|
} |
| 143 |
|
} |
| 144 |
|
|
src/Adapters/GuzzleHttpAdapter.php 1 location
|
@@ 137-143 (lines=7) @@
|
| 134 |
|
/** |
| 135 |
|
* @throws HttpException |
| 136 |
|
*/ |
| 137 |
|
protected function handleError() |
| 138 |
|
{ |
| 139 |
|
$body = (string) $this->response->getBody(); |
| 140 |
|
$code = (int) $this->response->getStatusCode(); |
| 141 |
|
$content = json_decode($body); |
| 142 |
|
throw new HttpException(isset($content->message) ? $content->message : 'Request not processed.', $code); |
| 143 |
|
} |
| 144 |
|
} |
| 145 |
|
|