collapse_excgroups
context manager removing exception context
#2746
Unanswered
ccrims0n
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
-
collapse_excgroups
used in theBaseHTTPMiddleware
has the following code:The last line of this function updates the
__context__
of the exception object,exc
. This also adds unnecessary contextAnother exception happened during the handling of exception
.I am not sure if this is by design but this is unnecessary and can obscure details of how the exception was raised.
Fix
Both the cases, exception group object and the exception object should be handled separately. Only
raise
should be used to re-raise caught exception. For the exception group, the right way needs to be figured out.Beta Was this translation helpful? Give feedback.
All reactions