bugsnag / bugsnag-python

Official BugSnag error monitoring and error reporting for django, flask, tornado and other python apps.
https://docs.bugsnag.com/platforms/python/
MIT License
86 stars 42 forks source link

Fix `ExceptionGroup` support when there is also a `__cause__` or `__context__` #336

Closed imjoehaines closed 1 year ago

imjoehaines commented 1 year ago

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 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