mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Update docs
This commit is contained in:
parent
3f85b476fa
commit
478c8d724b
|
@ -51,10 +51,10 @@ In order to alter the style of the response, you could write the following custo
|
||||||
|
|
||||||
from rest_framework.views import exception_handler
|
from rest_framework.views import exception_handler
|
||||||
|
|
||||||
def custom_exception_handler(exc):
|
def custom_exception_handler(exc, context):
|
||||||
# Call REST framework's default exception handler first,
|
# Call REST framework's default exception handler first,
|
||||||
# to get the standard error response.
|
# to get the standard error response.
|
||||||
response = exception_handler(exc)
|
response = exception_handler(exc, context)
|
||||||
|
|
||||||
# Now add the HTTP status code to the response.
|
# Now add the HTTP status code to the response.
|
||||||
if response is not None:
|
if response is not None:
|
||||||
|
|
|
@ -393,7 +393,7 @@ This setting can be changed to support error responses other than the default `{
|
||||||
|
|
||||||
This should be a function with the following signature:
|
This should be a function with the following signature:
|
||||||
|
|
||||||
exception_handler(exc)
|
exception_handler(exc, context)
|
||||||
|
|
||||||
* `exc`: The exception.
|
* `exc`: The exception.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user