Skip to content

Commit 063795f

Browse files
author
Kyra Farrow
committed
[HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error
1 parent 89a4da6 commit 063795f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Exception/JsonException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\HttpClient\Exception;
1313

14-
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
14+
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
1515

1616
/**
1717
* Thrown by responses' toArray() method when their content cannot be JSON-decoded.
@@ -20,6 +20,6 @@
2020
*
2121
* @experimental in 4.3
2222
*/
23-
final class JsonException extends \JsonException implements TransportExceptionInterface
23+
final class JsonException extends \JsonException implements DecodingExceptionInterface
2424
{
2525
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require": {
2222
"php": "^7.1.3",
2323
"psr/log": "^1.0",
24-
"symfony/http-client-contracts": "^1.1.3",
24+
"symfony/http-client-contracts": "^1.1.4",
2525
"symfony/polyfill-php73": "^1.11"
2626
},
2727
"require-dev": {

0 commit comments

Comments
 (0)