Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception level filter not working for custom exception #1155

Open
arahman4710 opened this issue Apr 9, 2024 · 2 comments
Open

Exception level filter not working for custom exception #1155

arahman4710 opened this issue Apr 9, 2024 · 2 comments
Labels

Comments

@arahman4710
Copy link

Hey rollbar team,

I'm trying to ignore a specific exception but its not working

In my initializer/rollbar.rb, I have

config.exception_level_filters.merge!('CustomAuthenticationError' => 'ignore')

and I'm raising CustomAuthenticationError which is the following code:

class CustomAuthenticationError < StandardError
  def initialize(message = nil)
    super(message)
  end
end

Ignoring ActionController::RoutingError works just not for my own exception. What am i missing?

Thanks!

@linear linear bot added the Ruby label Apr 9, 2024
@waltjones
Copy link
Contributor

I tested here, and it's working for me. Is it possible the error class is nested?

Something like this

class TestController < ApplicationController
  class TestError < StandardError; end
end

will need to use

config.exception_level_filters.merge!('TestController::TestError' => 'ignore')

Otherwise, the filter depends on exception.class.name. You could try printing this for your exception class to be sure it matches the string you're using.

@alif
Copy link

alif commented Jun 12, 2024

@arahman4710 are you still having trouble with this? Were you able to test what @waltjones proposed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants