In #332 we now extract sub-exceptions from an ExceptionGroup, but this didn't work correctly when the group had a __cause__ or __context__. This is because we re-use the exception variable when traversing the cause/context chain, so it would point to the wrong exception object when we checked for an ExceptionGroup
We now use the Event's original_error instead, which will always point to the reported exception object
Goal
In #332 we now extract sub-exceptions from an
ExceptionGroup
, but this didn't work correctly when the group had a__cause__
or__context__
. This is because we re-use theexception
variable when traversing the cause/context chain, so it would point to the wrong exception object when we checked for anExceptionGroup
We now use the Event's
original_error
instead, which will always point to the reported exception object