Skip to content

Doc about server exception option in ErrorPlugin #235

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 2 commits into from
May 28, 2018
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
5 changes: 5 additions & 0 deletions plugins/error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ writing a library around an API, the best practice is to have the client convert
domain objects, and transform HTTP errors into meaningful domain exceptions. In that scenario,
the ErrorPlugin is not needed. It is more efficient to check the HTTP status codes yourself than
throwing and catching exceptions.

If your application handles responses with 4xx status codes, but needs exceptions for 5xx status codes only,
you can set the option ``only_server_exception`` to ``true``::

$errorPlugin = new ErrorPlugin(['only_server_exception' => true]);