René's URL Explorer Experiment


Title: Handle control flow exceptions when assigning span status · Issue #6408 · getsentry/sentry-python · GitHub

Open Graph Title: Handle control flow exceptions when assigning span status · Issue #6408 · getsentry/sentry-python

X Title: Handle control flow exceptions when assigning span status · Issue #6408 · getsentry/sentry-python

Description: We have a few cases of libraries using custom exception types as control flow signals, e.g.: HueyControlFlowExceptions LangGraph's GraphInterrupt and GraphBubbleUp: #6384 The should_be_treated_as_error() function is currently used to det...

Open Graph Description: We have a few cases of libraries using custom exception types as control flow signals, e.g.: HueyControlFlowExceptions LangGraph's GraphInterrupt and GraphBubbleUp: #6384 The should_be_treated_as_e...

X Description: We have a few cases of libraries using custom exception types as control flow signals, e.g.: HueyControlFlowExceptions LangGraph's GraphInterrupt and GraphBubbleUp: #6384 The should_be_treated_...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handle control flow exceptions when assigning span status","articleBody":"We have a few cases of libraries using custom exception types as control flow signals, e.g.:\n- `HueyControlFlowExceptions`\n- LangGraph's `GraphInterrupt` and `GraphBubbleUp`: https://github.com/getsentry/sentry-python/issues/6384\n\nThe [`should_be_treated_as_error()`](https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/utils.py#L1986) function is currently used to determine whether a transaction or span is assigned the `internal_error` or `error` status [in `Span.__exit__()`](https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/tracing.py#L398) and [in `StreamedSpan.__exit__()`](https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/traces.py#L335), respectively. As `should_be_treated_as_error()` currently holds an ever-expanding number of special cases, code is added that does not apply in the majority of cases (dead code if the relevant integrations did not create the span). \n\n**Proposal**\n\nAdd a parameter to `Span.__init__()`, `start_span()`, `start_transaction()` and `start_child()` (and equivalent span streaming APIs) that accepts a set or tuple of control flow exceptions. Special case against the exceptions in the set on `__exit__()`. The parameter can be called `control_flow_exceptions`.\n\nFor example, in the AIOHTTP integration, the parameter would be set to `control_flow_exceptions=(AIOHttpHttpException, )`.","author":{"url":"https://github.com/alexander-alderman-webb","@type":"Person","name":"alexander-alderman-webb"},"datePublished":"2026-05-26T09:20:08Z","url":"https://github.com/getsentry/sentry-python/issues/6408"}

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:277e4ca2-3f8f-3c1e-34b3-51d062b496c1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB778:26ECEB:343457:44D50B:6B00C391
html-safe-nonced26188fd111383efbc99862b49c62c44c7c6add63d6750ed4afefd0f2947e508
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzc4OjI2RUNFQjozNDM0NTc6NDRENTBCOjZCMDBDMzkxIiwidmlzaXRvcl9pZCI6IjQwNjIxNzQ0MDk1ODUxMTYwNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacec964bb00d73b4085be3379bfd70b33f4a67a9e6c6250da549372ceb092a3502
hovercard-subject-tagissue:4523011382
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/6408/issue_layout
twitter:imagehttps://opengraph.githubassets.com/30653ede80dec895644bdbdb8ab0d8bca94f41a13e0dfdddf292cd0dd9c0a03d/getsentry/sentry-python/issues/6408
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/30653ede80dec895644bdbdb8ab0d8bca94f41a13e0dfdddf292cd0dd9c0a03d/getsentry/sentry-python/issues/6408
og:image:altWe have a few cases of libraries using custom exception types as control flow signals, e.g.: HueyControlFlowExceptions LangGraph's GraphInterrupt and GraphBubbleUp: #6384 The should_be_treated_as_e...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealexander-alderman-webb
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/6408#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F6408
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%2F6408
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/6408
Reloadhttps://github.com/getsentry/sentry-python/issues/6408
Reloadhttps://github.com/getsentry/sentry-python/issues/6408
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/6408
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/6408
#6425https://github.com/getsentry/sentry-python/pull/6425
Handle control flow exceptions when assigning span statushttps://github.com/getsentry/sentry-python/issues/6408#top
#6425https://github.com/getsentry/sentry-python/pull/6425
https://github.com/alexander-alderman-webb
https://github.com/alexander-alderman-webb
alexander-alderman-webbhttps://github.com/alexander-alderman-webb
on May 26, 2026https://github.com/getsentry/sentry-python/issues/6408#issue-4523011382
LangchainIntegration reports GraphInterrupt / GraphBubbleUp as errors via on_tool_error #6384https://github.com/getsentry/sentry-python/issues/6384
should_be_treated_as_error()https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/utils.py#L1986
in Span.__exit__()https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/tracing.py#L398
in StreamedSpan.__exit__()https://github.com/getsentry/sentry-python/blob/212e0cde3426ca9ea96ae737d74e0d972bbf1f18/sentry_sdk/traces.py#L335
alexander-alderman-webbhttps://github.com/alexander-alderman-webb
on May 26, 2026https://github.com/getsentry/sentry-python/issues/6408#event-25960513890
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on May 26, 2026https://github.com/getsentry/sentry-python/issues/6408#issuecomment-4542735855
Linear Codehttps://linear.app
PY-2492https://linear.app/getsentry/issue/PY-2492
https://github.com/alexander-alderman-webb
alexander-alderman-webbhttps://github.com/alexander-alderman-webb
on May 26, 2026https://github.com/getsentry/sentry-python/issues/6408#issuecomment-4543905754
https://github.com/sentrivana
sentrivanahttps://github.com/sentrivana
on May 27, 2026https://github.com/getsentry/sentry-python/issues/6408#issuecomment-4552362630
herehttps://github.com/getsentry/sentry-python/blob/bb3fcb41d40732c7b2c2a1684c7af94e5731d9da/sentry_sdk/serializer.py#L57-L61
registerhttps://github.com/getsentry/sentry-python/blob/bb3fcb41d40732c7b2c2a1684c7af94e5731d9da/sentry_sdk/integrations/django/__init__.py#L846
https://github.com/sentrivana
sentrivanahttps://github.com/sentrivana
on May 27, 2026https://github.com/getsentry/sentry-python/issues/6408#issuecomment-4552430091
https://github.com/getsentry/sentry-python/pull/6425/changeshttps://github.com/getsentry/sentry-python/pull/6425/changes
sentrivanahttps://github.com/sentrivana
on May 27, 2026https://github.com/getsentry/sentry-python/issues/6408#event-26006159063
feat: Allow integrations to define control flow exceptions (#6425)https://github.com/getsentry/sentry-python/commit/05432abdf208e3b4b94d1bc4c50fa914bc6a06da
#6425https://github.com/getsentry/sentry-python/pull/6425
05432abhttps://github.com/getsentry/sentry-python/commit/05432abdf208e3b4b94d1bc4c50fa914bc6a06da
sentrivanahttps://github.com/sentrivana
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#6425https://github.com/getsentry/sentry-python/pull/6425
on May 27, 2026https://github.com/getsentry/sentry-python/issues/6408#event-26006159131
mgalignianahttps://github.com/mgaligniana
on Aug 9, 2026https://github.com/getsentry/sentry-python/issues/6408#event-29172581674
feat: Allow integrations to define control flow exceptions (getsentry…https://github.com/mgaligniana/sentry-python/commit/6f81d8e8445e32ebb209f5c177b4b873920df47e
getsentry…https://github.com/getsentry/sentry-python/pull/6425
6f81d8ehttps://github.com/mgaligniana/sentry-python/commit/6f81d8e8445e32ebb209f5c177b4b873920df47e
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/6408
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/6408
alexander-alderman-webbhttps://github.com/alexander-alderman-webb
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.