Skip to content

add warning in error plugin #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The ``ErrorPlugin`` transforms responses with HTTP error status codes into excep
* 400-499 status code are transformed into ``Http\Client\Common\Exception\ClientErrorException``;
* 500-599 status code are transformed into ``Http\Client\Common\Exception\ServerErrorException``

.. warning::

Throwing an exception on a valid response violates the PSR-18 specification.
This plugin is provided as a convenience when writing a small application.
When providing a client to a third party library, this plugin must not be
included, or the third party library will have problems with error handling.

Both exceptions extend the ``Http\Client\Exception\HttpException`` class, so you can fetch the request
and the response coming from them::

Expand Down