mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
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.
This commit is contained in:
parent
2921455ea7
commit
77ced39e6c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user