Skip to content

Commit

Permalink
Doc about server exception option in ErrorPlugin (#235)
Browse files Browse the repository at this point in the history
Doc about server exception option in ErrorPlugin
  • Loading branch information
joelwurtz authored and dbu committed May 28, 2018
1 parent a5f05eb commit 03e782c
Showing 1 changed file with 5 additions and 0 deletions.
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]);

0 comments on commit 03e782c

Please sign in to comment.