From 89020ae9248d41ea9b4095e273e8ce58409c7fdb Mon Sep 17 00:00:00 2001 From: RinZ27 <222222878+RinZ27@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:27:45 +0700 Subject: [PATCH] Ensure proper Exception inheritance in APIException subclasses --- rest_framework/exceptions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 09f111102e..052ed46b8e 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -112,6 +112,7 @@ def __init__(self, detail=None, code=None): 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 @@ def __init__(self, detail=None, code=None): detail = [detail] self.detail = _get_error_details(detail, code) + super().__init__(self.detail, code) class ParseError(APIException):