Change context argument for custom_exception_handler to dictionary

This commit is contained in:
Muizudeen Kusimo 2015-10-16 15:02:34 -04:00
parent c94b354efa
commit 9a4eff6820

View File

@ -61,10 +61,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, context): 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, context) 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: