mirror of
https://github.com/encode/django-rest-framework.git
synced 2026-02-17 20:50:35 +03:00
Ensure proper Exception inheritance in APIException subclasses
This commit is contained in:
parent
b5455c5daf
commit
89020ae924
|
|
@ -112,6 +112,7 @@ class APIException(Exception):
|
|||
code = self.default_code
|
||||
|
||||
self.detail = _get_error_details(detail, code)
|
||||
super().__init__(self.detail)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.detail)
|
||||
|
|
@ -159,6 +160,7 @@ class ValidationError(APIException):
|
|||
detail = [detail]
|
||||
|
||||
self.detail = _get_error_details(detail, code)
|
||||
super().__init__(self.detail, code)
|
||||
|
||||
|
||||
class ParseError(APIException):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user