This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Raising exceptions with registered exception handlers from BackgroundTasks causes starlette exception #3589
Labels
You can continue the conversation there. Go to discussion →
First check
Example
Description
Raising an exception that an exception_handler is registered for, from a background task - causes an error from starlette, which also hides the original exception.
running the code from the example, and triggering the endpoint, i expected the error to be either handled by the exception handler, or maybe just ignoring the exception handler as this exception does not happen as part of a request context.
the actual behavior is as follows
I understand this might be connected to a starlette design decision from previous discussions, but haven't actually seen this exact cause for the problem.
Environment
The text was updated successfully, but these errors were encountered: