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

New exception to add to ignored_exceptions #506

Open
akaspick opened this issue Apr 8, 2021 · 2 comments
Open

New exception to add to ignored_exceptions #506

akaspick opened this issue Apr 8, 2021 · 2 comments

Comments

@akaspick
Copy link

akaspick commented Apr 8, 2021

Rails 6.1 includes a new exception ActionDispatch::Http::MimeNegotiation::InvalidType (rails/rails#40353) that should be added to list of default ignored exceptions.

This new exception can't be caught in a Rails app via rescue_from as the error occurs too early in the call stack. See the Rails discussion for additional details.

Currently when this exception is caught with the exception_notificaition gem the following is shown in the error report:

-------------------------------
Request:
-------------------------------

  ERROR: Failed to generate exception summary:

Additional discussion can be found at rails/rails#37620

@ansonhoyt
Copy link

This does seem like a good default. I've started including this exception in my apps' config/initializers/exception_notification.rb initializer:

   # Ignore additional exception types.
   # ActiveRecord::RecordNotFound, AbstractController::ActionNotFound and ActionController::RoutingError
   # are already added.
   config.ignored_exceptions += %w[
     ActionController::InvalidAuthenticityToken
+    ActionDispatch::Http::MimeNegotiation::InvalidType
   ]

@dave105010
Copy link

dave105010 commented May 5, 2021

Will this be merged soon and included in the new version of exception_notification gem?

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

No branches or pull requests

3 participants