Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FIX] fastapi: Handle error occurring outside the fastapi processing #453

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion fastapi/fastapi_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from contextlib import contextmanager
from io import BytesIO

from werkzeug.exceptions import InternalServerError

from odoo.http import Dispatcher, request

from .context import odoo_env_ctx
Expand Down Expand Up @@ -35,7 +37,10 @@ def dispatch(self, endpoint, args):
)

def handle_error(self, exc):
pass
# At this stage all the normal exceptions are handled by FastAPI
# and we should only have InternalServerError occurring after the
# FastAPI app has been called.
return InternalServerError() # pragma: no cover

def _make_response(self, status_mapping, headers_tuple, content):
self.status = status_mapping[:3]
Expand Down
Loading