Skip to content

Commit 0c842fb

Browse files
committed
[FIX] fastapi_backport: Protect against inner_exception attribute error
1 parent 4d84ebd commit 0c842fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fastapi_backport/http.py

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def __init__(self, *args):
4242
super().__init__(*args)
4343
self.params = {}
4444
self._dispatcher = http._dispatchers.get("fastapi", FastApiDispatcher)(self)
45+
# Ensure inner_exception exists on dispatcher since the flow on error
46+
# is quite different
47+
self._dispatcher.inner_exception = None
4548

4649
def make_response(self, data, headers=None, cookies=None, status=200):
4750
"""Helper for non-HTML responses, or HTML responses with custom

0 commit comments

Comments
 (0)