René's URL Explorer Experiment


Title: If Exception.__context__ is an ExceptionGroup, Sentry doesn't capture the ExceptionGroup's children · Issue #3913 · getsentry/sentry-python · GitHub

Open Graph Title: If Exception.__context__ is an ExceptionGroup, Sentry doesn't capture the ExceptionGroup's children · Issue #3913 · getsentry/sentry-python

X Title: If Exception.__context__ is an ExceptionGroup, Sentry doesn't capture the ExceptionGroup's children · Issue #3913 · getsentry/sentry-python

Description: How do you use Sentry? Sentry Saas (sentry.io) Version 1.29.2 Steps to Reproduce Here's a toy example that demonstrates the problem: try: try: raise ExceptionGroup("group", [ValueError("child1"), ValueError("child2")]) finally: raise Typ...

Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version 1.29.2 Steps to Reproduce Here's a toy example that demonstrates the problem: try: try: raise ExceptionGroup("group", [ValueError("child1"), V...

X Description: How do you use Sentry? Sentry Saas (sentry.io) Version 1.29.2 Steps to Reproduce Here's a toy example that demonstrates the problem: try: try: raise ExceptionGroup("group", [ValueErro...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/3913

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"If Exception.__context__ is an ExceptionGroup, Sentry doesn't capture the ExceptionGroup's children","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\n1.29.2\n\n### Steps to Reproduce\n\nHere's a toy example that demonstrates the problem:\n```python\ntry:\n    try:\n        raise ExceptionGroup(\"group\", [ValueError(\"child1\"), ValueError(\"child2\")])\n    finally:\n        raise TypeError(\"bar\")\nexcept BaseException:\n    sentry_sdk.capture_exception()\n```\n\n`sentry_sdk.capture_exception()` receives the `TypeError`. `TypeError.__context__` points to the `ExceptionGroup`; and then `ExceptionGroup.exceptions` points to `[ValueError(\"child1\"), ValueError(\"child2\")]`.\n\n### Expected Result\n\nThe Sentry event should contain all four exceptions: the `TypeError`, the `ExceptionGroup`, and the sub-exceptions `ValueError(\"child1\")` and `ValueError(\"child2\")`.\n\nAdditionally, the event should record that the `ExceptionGroup` is `TypeError.__context__` as opposed to `TypeError.__cause__`.\n\nNote that the `sentry_sdk.utils.exceptions_from_error()` function actually does this correctly, but it isn't getting invoked in this case. Here's a screenshot of how it looks if I patch the Sentry SDK to always use `sentry_sdk.utils.exceptions_from_error()`:\n\n\u003cimg width=\"745\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/1c4bfbff-e300-408f-8b7c-9c82a7d3a192\" />\n\n\n### Actual Result\n\nWhen the `TypeError` is passed into `sentry_sdk.utils.exceptions_from_error_tuple()`, it checks whether the `TypeError` is an `ExceptionGroup` or not: https://github.com/getsentry/sentry-python/blob/2.19.2/sentry_sdk/utils.py#L968-L1009 Because the `TypeError` is not an `ExceptionGroup`, it calls `walk_exception_chain()`, which examines `TypeError.__context__` to find the `ExceptionGroup`; but it doesn't recurse into the sub-exceptions `ValueError(\"child1\")` and `ValueError(\"child2\")`. So the Sentry event only contains the `TypeError` and the `ExceptionGroup`:\n\n\u003cimg width=\"745\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/e5fb6d10-7b2b-4a59-9a9e-d9c173d2b06a\" />\n\nAlso, the \"Related Exceptions\" tree in the above screenshot appears to be nonsensical.\n\nI tested this with SDK version 1.29.2, but the bug appears to still be present in the latest version of the code.","author":{"url":"https://github.com/tmaxwell-anthropic","@type":"Person","name":"tmaxwell-anthropic"},"datePublished":"2025-01-10T04:57:21Z","url":"https://github.com/getsentry/sentry-python/issues/3913"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0fc4f56e-e103-b84e-ebb7-9887f10f327b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDF46:3897F3:223827:2D4B5F:6B00C00A
html-safe-nonce55213d08ab203c4bb671cb05ee8ef5f4538f7633b5141ac5e9506c53c799afcd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjQ2OjM4OTdGMzoyMjM4Mjc6MkQ0QjVGOjZCMDBDMDBBIiwidmlzaXRvcl9pZCI6IjEyMzg0NjAyMTI1MDgxNDc3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc3d2561e133a6e8936a82d5b66c4bac4cfd3148be30ebe90e0f2a8c12f7bb213
hovercard-subject-tagissue:2779285738
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/3913/issue_layout
twitter:imagehttps://opengraph.githubassets.com/39dc4217e3c87231d127aeb79437060f5c43ab890a4a0d83bb6967b78118241c/getsentry/sentry-python/issues/3913
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/39dc4217e3c87231d127aeb79437060f5c43ab890a4a0d83bb6967b78118241c/getsentry/sentry-python/issues/3913
og:image:altHow do you use Sentry? Sentry Saas (sentry.io) Version 1.29.2 Steps to Reproduce Here's a toy example that demonstrates the problem: try: try: raise ExceptionGroup("group", [ValueError("child1"), V...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametmaxwell-anthropic
hostnamegithub.com
expected-hostnamegithub.com
None93edd3bebc4afb7ce711ee74cb5d2a95927850b082a4d43e212222389cb1c415
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1fee81a280ea86312b69448e261b418189bfd5b5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/3913#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F3913
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F3913
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/3913
Reloadhttps://github.com/getsentry/sentry-python/issues/3913
Reloadhttps://github.com/getsentry/sentry-python/issues/3913
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests42 (42)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3913
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3913
#4164https://github.com/getsentry/sentry-python/pull/4164
If Exception.__context__ is an ExceptionGroup, Sentry doesn't capture the ExceptionGroup's childrenhttps://github.com/getsentry/sentry-python/issues/3913#top
#4164https://github.com/getsentry/sentry-python/pull/4164
https://github.com/antonpirker
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
Component: SDK CoreDealing with the core of the SDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Component%3A%20SDK%20Core%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
https://github.com/tmaxwell-anthropic
tmaxwell-anthropichttps://github.com/tmaxwell-anthropic
on Jan 10, 2025https://github.com/getsentry/sentry-python/issues/3913#issue-2779285738
https://private-user-images.githubusercontent.com/122412227/401820643-1c4bfbff-e300-408f-8b7c-9c82a7d3a192.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyMTE1NzUsIm5iZiI6MTc5NTIxMTI3NSwicGF0aCI6Ii8xMjI0MTIyMjcvNDAxODIwNjQzLTFjNGJmYmZmLWUzMDAtNDA4Zi04YjdjLTljODJhN2QzYTE5Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYxMTIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MTEyMFQyMTQ3NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMjRmZDJkMmZhY2M2NDRiYmY0MTNlMzgzNDUyYzg5OWY5NmExMzY2YzE1YTRiNzdlMmMxODZmYjdiMWYwNzQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.oxJrOU8jvQtRpflHnVDtAcPl3fw1IFQ5gJLIYhJxIIc
https://github.com/getsentry/sentry-python/blob/2.19.2/sentry_sdk/utils.py#L968-L1009https://github.com/getsentry/sentry-python/blob/2.19.2/sentry_sdk/utils.py#L968-L1009
https://private-user-images.githubusercontent.com/122412227/401819832-e5fb6d10-7b2b-4a59-9a9e-d9c173d2b06a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyMTE1NzUsIm5iZiI6MTc5NTIxMTI3NSwicGF0aCI6Ii8xMjI0MTIyMjcvNDAxODE5ODMyLWU1ZmI2ZDEwLTdiMmItNGE1OS05YTllLWQ5YzE3M2QyYjA2YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYxMTIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MTEyMFQyMTQ3NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNDExODNkMWI4NmVkOTk0OTYxMjczY2ZkYTM4OWMwODlmMDYyNTZiNTA4ZDNkMDhhNDQ0ZDlkMjQyZGNjNDYwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.N2DYiT_-fgyrwqAMReZfnqbLHxk_z8wNuPfnvEwA0Uk
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jan 10, 2025https://github.com/getsentry/sentry-python/issues/3913#event-15876645792
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jan 10, 2025https://github.com/getsentry/sentry-python/issues/3913
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jan 10, 2025https://github.com/getsentry/sentry-python/issues/3913#event-15876647016
https://github.com/tmaxwell-anthropic
tmaxwell-anthropichttps://github.com/tmaxwell-anthropic
on Jan 10, 2025https://github.com/getsentry/sentry-python/issues/3913#issuecomment-2581774197
herehttps://github.com/getsentry/sentry-python/blob/2.19.2/sentry_sdk/utils.py#L914-L923
herehttps://github.com/getsentry/sentry-python/blob/2.19.2/sentry_sdk/utils.py#L936-L945
antonpirkerhttps://github.com/antonpirker
Component: SDK CoreDealing with the core of the SDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Component%3A%20SDK%20Core%22
on Jan 13, 2025https://github.com/getsentry/sentry-python/issues/3913#event-15902941020
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jan 13, 2025https://github.com/getsentry/sentry-python/issues/3913#event-15902941267
https://github.com/antonpirker
antonpirkerhttps://github.com/antonpirker
on Jan 13, 2025https://github.com/getsentry/sentry-python/issues/3913#issuecomment-2586767786
@tmaxwell-anthropichttps://github.com/tmaxwell-anthropic
antonpirkerhttps://github.com/antonpirker
on Mar 4, 2025https://github.com/getsentry/sentry-python/issues/3913#event-16553925230
antonpirkerhttps://github.com/antonpirker
Better handling of exception groups #4164https://github.com/getsentry/sentry-python/pull/4164
on Mar 19, 2025https://github.com/getsentry/sentry-python/issues/3913#event-16861150522
antonpirkerhttps://github.com/antonpirker
on Mar 20, 2025https://github.com/getsentry/sentry-python/issues/3913#event-16912514978
Better handling of exception groups (#4164)https://github.com/getsentry/sentry-python/commit/2753face06b02b0aad28e53d73e87ef3b9616cb2
#4164https://github.com/getsentry/sentry-python/pull/4164
https://docs.github.com/articles/closing-issues-via-commit-messages
2753fachttps://github.com/getsentry/sentry-python/commit/2753face06b02b0aad28e53d73e87ef3b9616cb2
https://github.com/antonpirker
antonpirkerhttps://github.com/antonpirker
on Mar 20, 2025https://github.com/getsentry/sentry-python/issues/3913#issuecomment-2740752809
antonpirkerhttps://github.com/antonpirker
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 20, 2025https://github.com/getsentry/sentry-python/issues/3913#event-16912544340
stephanie-andersonhttps://github.com/stephanie-anderson
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3913#event-17953898766
stephanie-andersonhttps://github.com/stephanie-anderson
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3913#event-17954558525
linearhttps://github.com/apps/linear
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3913#event-17957846482
dingsdaxhttps://github.com/dingsdax
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
on Mar 24, 2026https://github.com/getsentry/sentry-python/issues/3913#event-23842418506
sentrivanahttps://github.com/sentrivana
on Sep 24, 2026https://github.com/getsentry/sentry-python/issues/3913#event-31749865473
fix: Fix exception chains (#7552)https://github.com/getsentry/sentry-python/commit/cde3acaf3ab4e433d507b0c6efb36c5ae7aa6aaa
#7552https://github.com/getsentry/sentry-python/pull/7552
cde3acahttps://github.com/getsentry/sentry-python/commit/cde3acaf3ab4e433d507b0c6efb36c5ae7aa6aaa
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/3913
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3913
antonpirkerhttps://github.com/antonpirker
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
Component: SDK CoreDealing with the core of the SDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Component%3A%20SDK%20Core%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.