File tree 4 files changed +29
-4
lines changed
4 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \HttpClient \Exception ;
13
13
14
- use Symfony \Contracts \HttpClient \Exception \TransportExceptionInterface ;
14
+ use Symfony \Contracts \HttpClient \Exception \DecodingExceptionInterface ;
15
15
16
16
/**
17
17
* Thrown by responses' toArray() method when their content cannot be JSON-decoded.
20
20
*
21
21
* @experimental in 4.3
22
22
*/
23
- final class JsonException extends \JsonException implements TransportExceptionInterface
23
+ final class JsonException extends \JsonException implements DecodingExceptionInterface
24
24
{
25
25
}
Original file line number Diff line number Diff line change 21
21
"require" : {
22
22
"php" : " ^7.1.3" ,
23
23
"psr/log" : " ^1.0" ,
24
- "symfony/http-client-contracts" : " ^1.1.3 " ,
24
+ "symfony/http-client-contracts" : " ^1.1.4 " ,
25
25
"symfony/polyfill-php73" : " ^1.11"
26
26
},
27
27
"require-dev" : {
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <[email protected] >
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Contracts \HttpClient \Exception ;
13
+
14
+ /**
15
+ * When a content-type cannot be decoded to the expected representation.
16
+ *
17
+ * @author Nicolas Grekas <[email protected] >
18
+ *
19
+ * @experimental in 1.1
20
+ */
21
+ interface DecodingExceptionInterface extends ExceptionInterface
22
+ {
23
+ }
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Contracts \HttpClient ;
13
13
14
14
use Symfony \Contracts \HttpClient \Exception \ClientExceptionInterface ;
15
+ use Symfony \Contracts \HttpClient \Exception \DecodingExceptionInterface ;
15
16
use Symfony \Contracts \HttpClient \Exception \ExceptionInterface ;
16
17
use Symfony \Contracts \HttpClient \Exception \RedirectionExceptionInterface ;
17
18
use Symfony \Contracts \HttpClient \Exception \ServerExceptionInterface ;
@@ -64,7 +65,8 @@ public function getContent(bool $throw = true): string;
64
65
*
65
66
* @param bool $throw Whether an exception should be thrown on 3/4/5xx status codes
66
67
*
67
- * @throws TransportExceptionInterface When the body cannot be decoded or when a network error occurs
68
+ * @throws DecodingExceptionInterface When the body cannot be decoded to an array
69
+ * @throws TransportExceptionInterface When a network error occurs
68
70
* @throws RedirectionExceptionInterface On a 3xx when $throw is true and the "max_redirects" option has been reached
69
71
* @throws ClientExceptionInterface On a 4xx when $throw is true
70
72
* @throws ServerExceptionInterface On a 5xx when $throw is true
You can’t perform that action at this time.
0 commit comments