lib/sentry/rails/railtie.rb in sentry-rails-5.0.2 vs lib/sentry/rails/railtie.rb in sentry-rails-5.1.0

- old
+ new

@@ -44,10 +44,12 @@ patch_background_worker if defined?(ActiveRecord) override_streaming_reporter if defined?(ActionView) setup_backtrace_cleanup_callback inject_breadcrumbs_logger activate_tracing + + register_error_subscriber(app) if ::Rails.version.to_f >= 7.0 end runner do next unless Sentry.initialized? Sentry.configuration.background_worker_threads = 0 @@ -112,8 +114,13 @@ subscribers = Sentry.configuration.rails.tracing_subscribers Sentry::Rails::Tracing.register_subscribers(subscribers) Sentry::Rails::Tracing.subscribe_tracing_events Sentry::Rails::Tracing.patch_active_support_notifications end + end + + def register_error_subscriber(app) + require "sentry/rails/error_subscriber" + app.executor.error_reporter.subscribe(Sentry::Rails::ErrorSubscriber.new) end end end