File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 21
21
use AsyncAws \Core \Stream \ResultStream ;
22
22
use Psr \Log \LoggerInterface ;
23
23
use Psr \Log \LogLevel ;
24
+ use Symfony \Contracts \HttpClient \Exception \DecodingExceptionInterface ;
24
25
use Symfony \Contracts \HttpClient \Exception \TransportExceptionInterface ;
25
26
use Symfony \Contracts \HttpClient \HttpClientInterface ;
26
27
use Symfony \Contracts \HttpClient \ResponseInterface ;
@@ -316,6 +317,7 @@ public function getContent(): string
316
317
317
318
/**
318
319
* @throws NetworkException
320
+ * @throws UnparsableResponse
319
321
* @throws HttpException
320
322
*/
321
323
public function toArray (): array
@@ -324,6 +326,8 @@ public function toArray(): array
324
326
325
327
try {
326
328
return $ this ->httpResponse ->toArray (false );
329
+ } catch (DecodingExceptionInterface $ e ) {
330
+ throw new UnparsableResponse ('Could not parse response as array ' , 0 , $ e );
327
331
} finally {
328
332
$ this ->bodyDownloaded = true ;
329
333
}
You can’t perform that action at this time.
0 commit comments