From d1e77e8890744daefb73c31936852de4816b9b52 Mon Sep 17 00:00:00 2001 From: Oliver Sauder Date: Fri, 21 Aug 2020 23:02:00 +0200 Subject: [PATCH] Document setting JSON_API_UNIFORM_EXCEPTIONS Fixes #326 Extracted from #437 --- docs/usage.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index cdb335d6..5b7010d3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -237,6 +237,13 @@ class MyViewset(ModelViewSet): ``` +### Exception handling + +For the `exception_handler` class, if the optional `JSON_API_UNIFORM_EXCEPTIONS` is set to True, +all exceptions will respond with the JSON API [error format](http://jsonapi.org/format/#error-objects). + +When `JSON_API_UNIFORM_EXCEPTIONS` is False (the default), non-JSON API views will respond +with the normal DRF error format. ### Performance Testing