Skip to content

Commit d52ebfb

Browse files
authored
Handle JsonRest Exception code (#515)
1 parent 6f3faeb commit d52ebfb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Exception/Http/HttpExceptionTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public function __construct(ResponseInterface $response)
4848
$content = $response->getContent(false);
4949
$message = sprintf('HTTP %d returned for "%s".', $code, $url);
5050

51+
$this->awsType = $response->getHeaders(false)['x-amzn-errortype'][0] ?? null;
52+
5153
// Try json_decode it first, fallback to XML
5254
if ($body = json_decode($content, true)) {
5355
$this->parseJson($body);

0 commit comments

Comments
 (0)