Skip to content
Discussion options

You must be logged in to vote

I'm not sure if this is explained in FastAPI's docs, but it is in Starlette's: https://www.starlette.io/exceptions/#errors-and-handled-exceptions

HTTPException is considered a handled error by default, so it won't fall into an except block in outer middlewares.

I'm also using the solution mentioned by @TheBeege.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
Converted from issue

This discussion was converted from issue #1840 on February 28, 2023 18:40.