Skip to content

Commit 7c05803

Browse files
author
Kyra Farrow
committed
bug #32065 [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error (nicolas-grekas)
This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31913 | License | MIT | Doc PR | - As spotted in the linked issue, we are missing this type of exception. It's a bug at the contracts level. Commits ------- 3f167417fb [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error
2 parents e8ec3af + 063795f commit 7c05803

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)