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 2121use AsyncAws \Core \Stream \ResultStream ;
2222use Psr \Log \LoggerInterface ;
2323use Psr \Log \LogLevel ;
24+ use Symfony \Contracts \HttpClient \Exception \DecodingExceptionInterface ;
2425use Symfony \Contracts \HttpClient \Exception \TransportExceptionInterface ;
2526use Symfony \Contracts \HttpClient \HttpClientInterface ;
2627use Symfony \Contracts \HttpClient \ResponseInterface ;
@@ -316,6 +317,7 @@ public function getContent(): string
316317
317318 /**
318319 * @throws NetworkException
320+ * @throws UnparsableResponse
319321 * @throws HttpException
320322 */
321323 public function toArray (): array
@@ -324,6 +326,8 @@ public function toArray(): array
324326
325327 try {
326328 return $ this ->httpResponse ->toArray (false );
329+ } catch (DecodingExceptionInterface $ e ) {
330+ throw new UnparsableResponse ('Could not parse response as array ' , 0 , $ e );
327331 } finally {
328332 $ this ->bodyDownloaded = true ;
329333 }
You can’t perform that action at this time.
0 commit comments