You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With register_error_subscriber, view errors are reported twice: the wrapper by the middleware, and its cause by the error subscriber #3166
With config.rails.register_error_subscriber = true, every exception raised in a view becomes two Sentry issues.
Sentry::Rails::CaptureExceptions captures the ActionView::Template::Error and marks that object with @__sentry_captured.
ActionDispatch::Executor reports ExceptionWrapper#unwrapped_exception to Rails.error. For a template error, that's the wrapper's cause.
Sentry::Rails::ErrorSubscriber forwards that report. The cause isn't the marked object, so Hub#capture_exception doesn't skip it.
The two events have different types and stacks, so they group separately. When reloading is off, as in production, the executor reports outside the middleware's scope, so the second event also has no request URL or transaction. In development, ActionDispatch::Reloader reports the cause first, from inside the scope.
We tested this in the same app: it produced one event with request context, with reloading on and off. In Hub#capture_exception:
skip capturing when any exception in the cause chain is already marked as captured;
mark the whole chain after capturing.
The event already includes the chain, via Sentry::Utils::ExceptionCauseChain, so a later capture of any part of it duplicates information Sentry already has.
Activity
linear-code commentedon Oct 30, 2026
RUBY-239
fix(rails): dedupe the cause of a view error in CaptureExceptions only