exception_notification icon indicating copy to clipboard operation
exception_notification copied to clipboard

New exception to add to ignored_exceptions

Open akaspick opened this issue 4 years ago • 2 comments

Rails 6.1 includes a new exception ActionDispatch::Http::MimeNegotiation::InvalidType (https://github.com/rails/rails/pull/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 https://github.com/rails/rails/issues/37620

akaspick avatar Apr 08 '21 01:04 akaspick

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
   ]

ansonhoyt avatar Apr 27 '21 13:04 ansonhoyt

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

dave105010 avatar May 05 '21 02:05 dave105010