Skip to content

feat: Gracefully handle SDK callback exceptions - #3077

Open
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/wrap-callbacks
Open

feat: Gracefully handle SDK callback exceptions#3077
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/wrap-callbacks

Conversation

@sl0thentr0py

@sl0thentr0py sl0thentr0py commented Sep 9, 2026

Copy link
Copy Markdown
Member

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 event
  • before_send_transaction: return nil and drop the transaction
  • before_send_check_in: 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

Issues

@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

RUBY-211

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrap all SDK user callbacks in a try catch

1 participant