Repository navigation
fix: count exception filter and exception processor failures as callback_error, and stop dropping events when an SDK processor fails - #5688
Open
jamescrosswell wants to merge 4 commits into
Conversation
…ack_error, and stop dropping events when an SDK processor fails A throwing IExceptionFilter or ISentryEventExceptionProcessor now logs an error naming it, drops the event and records callback_error, rather than falling through to CaptureEvent's catch-all. SDK-owned event, exception and transaction processors implement an internal ISdkProcessor marker. When one throws, the error is logged and processing continues, so an SDK bug neither drops the user's data nor shows up in their Stats as their own callback failing. Closes #5684 Closes #5685 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5688 +/- ##
==========================================
+ Coverage 75.21% 75.22% +0.01%
==========================================
Files 515 516 +1
Lines 18989 19022 +33
Branches 3693 3698 +5
==========================================
+ Hits 14282 14310 +28
- Misses 3852 3857 +5
Partials 855 855 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamescrosswell
commented
Oct 7, 2026
Collaborator
Author
|
@ric-oliv looks like a lot to review but it's mostly just adding the marker attribute everywhere... then a few short lines checking for that marker attribute. |
ric-oliv
reviewed
Oct 9, 2026
ISentryStackTraceFactory can be user-supplied. Now that a failing SDK processor no longer drops the event, a throw from the factory would send an event with no SentryExceptions (MainExceptionProcessor) or without the enricher's SDK, environment and OS/runtime context (MainSentryEventProcessor). Catch it at both call sites, log it, and omit only the stack trace. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ric-oliv
approved these changes
Oct 9, 2026
ApplyExceptionFilters now catches only the filter call itself, logs and records callback_error there, and reports the failure through an out parameter. SDK code in the filtering path is no longer caught and miscounted as the user's callback_error; it reaches CaptureEvent's catch-all as before. Also cover a throwing scope.AddTransactionProcessor lambda, so marking DelegateTransactionProcessor as an SDK processor would fail a test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #5607, part of #5634. This covers items 3 and 4 there. They share a fix, so they're in one PR.
Summary
IExceptionFilterorISentryEventExceptionProcessorthrows, the SDK logs an error naming it, drops the event, and recordscallback_error. Before, the throw fell through toCaptureEvent's catch-all. That dropped the event, logged a generic message and counted nothing.ISdkProcessormarker. When one throws, the SDK logs the error and runs the remaining processors, as fix(core): [Callback Errors 3] Drop failed processor data sentry-java#6142 does. That's right for an SDK bug: the user's data isn't dropped, and the failure doesn't show up in their Stats as their own callback.Notes for review
callback_error. Now it's sent, without whatever that processor would have added.MainExceptionProcessorandMainSentryEventProcessor. Both calls now catch a failure there and log it. The event keeps its exception type, message and enrichment, and loses only the stack trace.DelegateEventProcessorandDelegateTransactionProcessorare deliberately not marked. They wrap the user's own lambdas (scope.AddEventProcessor(Func<…>)), and a test covers this.Sentry.Unityalready hasInternalsVisibleTo, so it can opt in later.Closes #5684
Closes #5685
🤖 Generated with Claude Code