Cannot add a custom handler for HTTPExceptions with status_code=500 #2499
Unanswered
clickonben
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found this through FastAPI but the code causing the problem appears to be in Starlette.
This exception handler never gets called. When I dug into it I found the problem was this:
in this file https://github.com/encode/starlette/blob/master/starlette/applications.py
I don't understand why it is doing this:
because if I change it to this:
Everything works as expected and my error handler handles 500 errors the same as any other status code.
Beta Was this translation helpful? Give feedback.
All reactions