Skip to content

Commit

Permalink
[FIX] fastapi_backport: Protect against inner_exception attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Jan 13, 2025
1 parent 4d84ebd commit 0c842fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fastapi_backport/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def __init__(self, *args):
super().__init__(*args)
self.params = {}
self._dispatcher = http._dispatchers.get("fastapi", FastApiDispatcher)(self)
# Ensure inner_exception exists on dispatcher since the flow on error
# is quite different
self._dispatcher.inner_exception = None

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

0 comments on commit 0c842fb

Please sign in to comment.