Title: Add opt-in strict callback mode · Issue #6662 · getsentry/sentry-java · GitHub
Open Graph Title: Add opt-in strict callback mode · Issue #6662 · getsentry/sentry-java
X Title: Add opt-in strict callback mode · Issue #6662 · getsentry/sentry-java
Description: The SDK isolates failures in user callbacks (beforeSend*, beforeBreadcrumb, samplers, event processors, etc.): the error is logged, the data is dropped, and a callback_error client report is recorded (#6081, released in 8.61.0). There is...
Open Graph Description: The SDK isolates failures in user callbacks (beforeSend*, beforeBreadcrumb, samplers, event processors, etc.): the error is logged, the data is dropped, and a callback_error client report is record...
X Description: The SDK isolates failures in user callbacks (beforeSend*, beforeBreadcrumb, samplers, event processors, etc.): the error is logged, the data is dropped, and a callback_error client report is record...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6662
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add opt-in strict callback mode","articleBody":"The SDK isolates failures in user callbacks (`beforeSend*`, `beforeBreadcrumb`, samplers, event processors, etc.): the error is logged, the data is dropped, and a `callback_error` client report is recorded (#6081, released in 8.61.0). There is currently no way to make those failures surface, which makes buggy callbacks hard to notice and debug during development.\n\nThe [callback error isolation spec](https://develop.sentry.dev/sdk/foundations/client/hooks/#callback-error-isolation) ([getsentry/sentry-docs#19189](https://github.com/getsentry/sentry-docs/pull/19189)) allows an opt-in strict mode:\n\n- **MAY** offer it, disabled by default.\n- In strict mode, a callback failure **MUST** propagate as an unhandled error of the host application instead of being isolated.\n- The event reporting that error **MUST NOT** go through the callback that failed.\n- Any callback failure while processing that event, or data created while reporting it (e.g. breadcrumbs), **MUST** be isolated instead of propagated.\n\nOutside strict mode, the SDK **MUST NOT** re-throw or capture callback errors as events.\n\n### Prior attempt\n\nA draft implementation was closed unmerged as not ready: #6173 (branch `feat/strict-callback-mode`, built on the callback-errors stack starting at #6140). It added a `strictCallbackMode` option (default off) with:\n\n- Callback failures wrapped in marker exceptions/errors with the original failure as cause, propagated via `ExceptionUtils.maybeRethrow()` before logging or discard accounting, including enclosing SDK catches and async completion paths.\n- Events containing a callback marker (incl. nested/cyclic causes and `ExceptionMechanismException`) silently excluded before capture callbacks, processors, logging, or discard accounting; same exclusion in the JUL, Logback, Log4j2, and Timber integrations.\n- Async failures following the host API's behavior (returned futures keep the failure; the SDK does not terminate the process).\n- Config via SDK options, `strict-callback-mode` external config, `io.sentry.strict-callback-mode` Android manifest metadata, and `sentry.strict-callback-mode` Spring Boot property.\n\nOpen points from review on #6173:\n\n- Design of `CallbackUtils`.\n- Some code paths started throwing where they previously swallowed exceptions independent of the flag, which would be a breaking change for a minor.\n- Marker logging during uncaught-exception capture, feedback dismiss-listener cleanup, and proxy-only Log4j2 events.\n\nRelated: #5513 (stop catching non-recoverable `Throwable`s in the next major) is a separate, broader change.\n\nShipping behind the flag in a minor and possibly flipping the default in a major was floated as an option.\n\n\u003c!-- junior-request-attribution:start -->\nvia **alexander.dinauer**.\n\u003c!-- junior-request-attribution:end -->\n\n\u003c!-- junior-session-footer:start -->\n\u003c!-- junior-conversation-id:slack%3AC0BLNS9KL8H%3A1790590434.129279 -->\n\n--\n\n[View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BLNS9KL8H%3A1790590434.129279) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BLNS9KL8H%3A1790590434.129279/?project=4510944073809921)\n\n\u003c!-- junior-session-footer:end -->","author":{"url":"https://github.com/apps/sentry-junior","@type":"Person","name":"sentry-junior"},"datePublished":"2026-11-18T12:59:47Z","url":"https://github.com/getsentry/sentry-java/issues/6662"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:82a1bda5-9d97-75be-baa1-119a38fd2ae6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9452:162CDA:2EAC83:40E8A6:6B046AE3 |
| html-safe-nonce | 15b8658cc531e081a55313ec7ad0b70884b503c91cf78fe8416a8d62446f4b7e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDUyOjE2MkNEQToyRUFDODM6NDBFOEE2OjZCMDQ2QUUzIiwidmlzaXRvcl9pZCI6IjI0NTIyNTAxMDUzMDMyOTY3MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eaa8905120303f2252dffa43dae4141a481ab374a7fddad749a014926c4059ee |
| hovercard-subject-tag | issue:6467687252 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6662/issue_layout |
| twitter:image | https://opengraph.githubassets.com/682068f0c02203aeaed7190a347c743749214a0cd86c944efbd72bd0fc341ab3/getsentry/sentry-java/issues/6662 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/682068f0c02203aeaed7190a347c743749214a0cd86c944efbd72bd0fc341ab3/getsentry/sentry-java/issues/6662 |
| og:image:alt | The SDK isolates failures in user callbacks (beforeSend*, beforeBreadcrumb, samplers, event processors, etc.): the error is logged, the data is dropped, and a callback_error client report is record... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sentry-junior[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width