Skip to content

Commit 5a340d9

Browse files
committed
Ensure proper Exception inheritance in APIException subclasses
1 parent b5455c5 commit 5a340d9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rest_framework/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def __init__(self, detail=None, code=None):
112112
code = self.default_code
113113

114114
self.detail = _get_error_details(detail, code)
115+
super().__init__(self.detail)
115116

116117
def __str__(self):
117118
return str(self.detail)
@@ -158,7 +159,7 @@ def __init__(self, detail=None, code=None):
158159
elif not isinstance(detail, dict) and not isinstance(detail, list):
159160
detail = [detail]
160161

161-
self.detail = _get_error_details(detail, code)
162+
super().__init__(detail, code)
162163

163164

164165
class ParseError(APIException):

0 commit comments

Comments
 (0)