Skip to content

fix: Fix exception chains - #7552

Open
sentrivana wants to merge 5 commits into
major/3.0from
ivana/major/chained-exceptions
Open

sentrivana wants to merge 5 commits into
major/3.0from
ivana/major/chained-exceptions

Conversation

@sentrivana

@sentrivana sentrivana commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Port of #4164

See #3913 for an example of an exception chain that is currently not working properly.

Closes https://linear.app/getsentry/issue/PY-1948/better-handling-of-exception-groups

@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

PY-1948

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

66094 passed | ⏭️ 3006 skipped | Total: 69100 | Pass Rate: 95.65% | Execution Time: 193m 31s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -67426
Passed Tests 📉 -63284
Failed Tests
Skipped Tests 📉 -4142

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2068 uncovered lines.


Generated by Codecov Action

sentrivana and others added 3 commits September 21, 2026 14:00
The huggingface_hub and strawberry tests were still asserting the
integration mechanism type at values[0], but with unified exception
chain handling, chained exceptions now appear at index 0 with
mechanism type "chained".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pamod-madubashana

This comment was marked as spam.

@sentrivana
sentrivana marked this pull request as ready for review September 22, 2026 09:33
@sentrivana
sentrivana requested a review from a team as a code owner September 22, 2026 09:33

@ericapisani ericapisani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, just need to update a couple of doc links in the comments 🚀

Comment thread sentry_sdk/utils.py
reconstruct the exception tree.
This will return a list of exceptions (a flattened tree of exceptions) in the
format of the Exception Interface documentation:
https://develop.sentry.dev/sdk/data-model/event-payloads/exception/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL looks like it needs to be updated - it 404s when I look this up

Comment thread sentry_sdk/utils.py
"""
Convert an exception into Sentry's structured "exception" format.

See https://develop.sentry.dev/sdk/data-model/event-payloads/exception/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 occurs for this link as well

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants