Skip to content

Commit

Permalink
Merge pull request #15885 from eduardoj/fix/issue_15745
Browse files Browse the repository at this point in the history
Ignore notifying `ActionController::BadRequest` errors
  • Loading branch information
eduardoj committed Mar 25, 2024
2 parents 0a61c6e + df8f09a commit 49f5b6a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/api/config/initializers/airbrake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ def ignore_by_backend_400_message?(message)
end

def ignore_by_class?(notice)
exceptions_to_ignore = ['ActiveRecord::RecordNotFound', 'ActionController::InvalidAuthenticityToken',
'CGI::Session::CookieStore::TamperedWithCookie', 'ActionController::UnknownAction',
'AbstractController::ActionNotFound', 'Bunny::TCPConnectionFailedForAllHosts',
'Timeout::Error', 'Net::HTTPBadResponse', 'Errno::ECONNRESET', 'Interrupt',
'RoutesHelper::WebuiMatcher::InvalidRequestFormat', 'ActionDispatch::Http::MimeNegotiation::InvalidType',
'ActionController::UnknownFormat', 'Backend::NotFoundError', 'AMQ::Protocol::EmptyResponseError']
exceptions_to_ignore = ['AMQ::Protocol::EmptyResponseError', 'AbstractController::ActionNotFound',
'ActionController::BadRequest', 'ActionController::InvalidAuthenticityToken',
'ActionController::UnknownAction', 'ActionController::UnknownFormat',
'ActionDispatch::Http::MimeNegotiation::InvalidType',
'ActiveRecord::RecordNotFound', 'Backend::NotFoundError',
'Bunny::TCPConnectionFailedForAllHosts', 'CGI::Session::CookieStore::TamperedWithCookie',
'Errno::ECONNRESET', 'Interrupt', 'Net::HTTPBadResponse',
'RoutesHelper::WebuiMatcher::InvalidRequestFormat', 'Timeout::Error']

notice[:errors].pluck(:type).intersect?(exceptions_to_ignore)
end
Expand Down

0 comments on commit 49f5b6a

Please sign in to comment.