Skip to content

Commit 6edf9cc

Browse files
authored
Merge pull request #248 from php-http/clarify-error-plugin
add warning in error plugin
2 parents d2ee81f + a9e4a61 commit 6edf9cc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/error.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The ``ErrorPlugin`` transforms responses with HTTP error status codes into excep
66
* 400-499 status code are transformed into ``Http\Client\Common\Exception\ClientErrorException``;
77
* 500-599 status code are transformed into ``Http\Client\Common\Exception\ServerErrorException``
88

9+
.. warning::
10+
11+
Throwing an exception on a valid response violates the PSR-18 specification.
12+
This plugin is provided as a convenience when writing a small application.
13+
When providing a client to a third party library, this plugin must not be
14+
included, or the third party library will have problems with error handling.
15+
916
Both exceptions extend the ``Http\Client\Exception\HttpException`` class, so you can fetch the request
1017
and the response coming from them::
1118

0 commit comments

Comments
 (0)