mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 00:19:53 +03:00
Preserve messages for wrapped Django exceptions
This commit is contained in:
parent
e92016ac2e
commit
0fe0f4e1b7
|
@ -79,9 +79,9 @@ def exception_handler(exc, context):
|
||||||
to be raised.
|
to be raised.
|
||||||
"""
|
"""
|
||||||
if isinstance(exc, Http404):
|
if isinstance(exc, Http404):
|
||||||
exc = exceptions.NotFound()
|
exc = exceptions.NotFound(*(exc.args))
|
||||||
elif isinstance(exc, PermissionDenied):
|
elif isinstance(exc, PermissionDenied):
|
||||||
exc = exceptions.PermissionDenied()
|
exc = exceptions.PermissionDenied(*(exc.args))
|
||||||
|
|
||||||
if isinstance(exc, exceptions.APIException):
|
if isinstance(exc, exceptions.APIException):
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user