Skip to content

Global Exception handler triggers ASGI Exception #11738

Discussion options

You must be logged in to vote

When you create an exception handler for Exception it works in a different way.

All the exceptions inherited from HTTPException are handled by ExceptionMiddleware, but all other exceptions (not inherited from HTTPException) go to ServerErrorMiddleware. And ServerErrorMiddleware re-raises all these exceptions. As I know you can't change it.

You can read more in starlette docs: https://www.starlette.io/exceptions/

Looks like the same question: #11348

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants