feat: Gracefully handle SDK callback exceptions - #3077
Open
sl0thentr0py wants to merge 1 commit into
Open
Conversation
sl0thentr0py
force-pushed
the
neel/wrap-callbacks
branch
from
September 9, 2026 14:42
d64658f to
1bf2fd1
Compare
The SDK now wraps user callbacks so that they don't unintentionally break your application if they raise inside the callback. - `before_send`: return nil and drop the event - `before_send_transaction`: return nil and drop the transaction - `before_send_check_in`: return nil and drop the check-in - `event_processor`: return nil and drop the event - `before_send_log`: return nil and drop the log item - `before_send_metric`: return nil and drop the metric item - `before_breadcrumb`: return nil and drop the breadcrumb - `traces_sampler`: fall back to `traces_sample_rate` - `backtrace_cleanup_callback`: fall back to the original backtrace - `std_lib_logger_filter`: return nil and skip the log
sl0thentr0py
force-pushed
the
neel/wrap-callbacks
branch
from
September 9, 2026 14:53
1bf2fd1 to
8ef67ce
Compare
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.
Changelog Entry
The SDK now wraps user callbacks so that they don't unintentionally break your application if they raise inside the callback.
before_send: return nil and drop the eventbefore_send_transaction: return nil and drop the transactionbefore_send_check_in: return nil and drop the transactionbefore_send_check_in: return nil and drop the check-inevent_processor: return nil and drop the eventbefore_send_log: return nil and drop the log itembefore_send_metric: return nil and drop the metric itembefore_breadcrumb: return nil and drop the breadcrumbtraces_sampler: fall back totraces_sample_ratebacktrace_cleanup_callback: fall back to the original backtracestd_lib_logger_filter: return nil and skip the logIssues