Closed jibiking closed 1 year ago
Hey, @jibiking
skip_bugsnag
works on the specific instance of the exception you apply it to. In your example you're applying it to exception
but raising a RoutingError
afterwards. That means that the RoutingError
doesn't have skip_bugsnag
applied to it, which results in it being reported to Bugsnag
To make it work you'd need to apply skip_bugsnag
to the RoutingError
before raising it, like this:
begin
raise StandardError
rescue StandardError => exception
Bugsnag.notify(exception)
routing_error = ActionController::RoutingError.new('not_found')
routing_error.instance_eval { def skip_bugsnag; true; end }
raise routing_error
end
If you want to ignore all RoutingError
exceptions, take a look at the discard_classes
configuration option
Hope that helps!
Describe the bug
The description in the official documentation states that even when using the "skip_bugsnag" configuration, notifications to Bugsnag are not stopping. Has the bug in this issue not been resolved? https://github.com/bugsnag/bugsnag-ruby/issues/470
Steps to reproduce
sample code↓
Environment