Skip to content

Commit 41c672a

Browse files
committed
Adjusted docs
1 parent aedf699 commit 41c672a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/http_client.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ Handling Exceptions
436436

437437
When the HTTP status code of the response is in the 300-599 range (i.e. 3xx,
438438
4xx or 5xx) your code is expected to handle it. If you don't do that, the
439-
``getHeaders()`` and ``getContent()`` methods throw an appropriate exception::
439+
``getHeaders()`` and ``getContent()`` methods throw an appropriate exception All of
440+
which implement the :class:`Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface`::
440441

441442
// the response of this request will be a 403 HTTP error
442443
$response = $client->request('GET', 'https://httpbin.org/status/403');
@@ -477,6 +478,14 @@ errors, exceptions will notify you when needed. On the other hand, if you write
477478
the error-handling code, you will opt-out from these fallback mechanisms as the
478479
destructor won't have anything remaining to do.
479480

481+
There are two types of exceptions:
482+
483+
* Exceptions implementing the :class:`Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface` are thrown when
484+
your code does not handle the status codes in the 300-599 range.
485+
486+
* Exceptions implementing the :class:`Symfony\\Contracts\\HttpClient\\Exception\\TransportExceptionInterface` are thrown
487+
when a lower level issue occurs.
488+
480489
Concurrent Requests
481490
-------------------
482491

0 commit comments

Comments
 (0)