@@ -998,10 +998,22 @@ In case the response was canceled using ``$response->cancel()``,
998998Handling Exceptions
999999~~~~~~~~~~~~~~~~~~~
10001000
1001+ There are three types of exceptions, all of which implement the
1002+ :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ ExceptionInterface `:
1003+
1004+ * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ HttpExceptionInterface `
1005+ are thrown when your code does not handle the status codes in the 300-599 range.
1006+
1007+ * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ TransportExceptionInterface `
1008+ are thrown when a lower level issue occurs.
1009+
1010+ * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ DecodingExceptionInterface `
1011+ are thrown when a content-type cannot be decoded to the expected representation.
1012+
10011013When the HTTP status code of the response is in the 300-599 range (i.e. 3xx,
100210144xx or 5xx) your code is expected to handle it. If you don't do that, the
1003- ``getHeaders() ``, ``getContent() `` and ``toArray() `` methods throw an appropriate exception, all of
1004- which implement the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ HttpExceptionInterface `::
1015+ ``getHeaders() ``, ``getContent() `` and ``toArray() `` methods throw an appropriate exception, which will
1016+ implement the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ HttpExceptionInterface `::
10051017
10061018 // the response of this request will be a 403 HTTP error
10071019 $response = $client->request('GET', 'https://httpbin.org/status/403');
@@ -1039,19 +1051,9 @@ responses in an array::
10391051This behavior provided at destruction-time is part of the fail-safe design of the
10401052component. No errors will be unnoticed: if you don't write the code to handle
10411053errors, exceptions will notify you when needed. On the other hand, if you write
1042- the error-handling code, you will opt-out from these fallback mechanisms as the
1043- destructor won't have anything remaining to do.
1044-
1045- There are three types of exceptions:
1046-
1047- * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ HttpExceptionInterface `
1048- are thrown when your code does not handle the status codes in the 300-599 range.
1049-
1050- * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ TransportExceptionInterface `
1051- are thrown when a lower level issue occurs.
1052-
1053- * Exceptions implementing the :class: `Symfony\\ Contracts\\ HttpClient\\ Exception\\ DecodingExceptionInterface `
1054- are thrown when a content-type cannot be decoded to the expected representation.
1054+ the error-handling code (by calling ``$response->getStatusCode() ``), you will
1055+ opt-out from these fallback mechanisms as the destructor won't have anything
1056+ remaining to do.
10551057
10561058Concurrent Requests
10571059-------------------
0 commit comments