Commit 77ced39e by Paul Melnikow

Fix doc for custom exception sample

The way to provide a default detail for APIException is to define a `default_detail` attribute on the subclass.

Defining a `detail` attribute without `default_detail` will not work, and will result in empty detail instead.
parent 2921455e
......@@ -94,7 +94,7 @@ For example, if your API relies on a third party service that may sometimes be u
class ServiceUnavailable(APIException):
status_code = 503
detail = 'Service temporarily unavailable, try again later.'
default_detail = 'Service temporarily unavailable, try again later.'
## ParseError
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment