module Sentry class Configuration attr_reader :rails def post_initialization_callback @rails = Sentry::Rails::Configuration.new @excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT) end end module Rails IGNORE_DEFAULT = [ 'AbstractController::ActionNotFound', 'ActionController::BadRequest', 'ActionController::InvalidAuthenticityToken', 'ActionController::InvalidCrossOriginRequest', 'ActionController::MethodNotAllowed', 'ActionController::NotImplemented', 'ActionController::ParameterMissing', 'ActionController::RoutingError', 'ActionController::UnknownAction', 'ActionController::UnknownFormat', 'ActionDispatch::Http::MimeNegotiation::InvalidType', 'ActionController::UnknownHttpMethod', 'ActionDispatch::Http::Parameters::ParseError', 'ActiveJob::DeserializationError', # Can cause infinite loops 'ActiveRecord::RecordNotFound' ].freeze class Configuration # Rails catches exceptions in the ActionDispatch::ShowExceptions or # ActionDispatch::DebugExceptions middlewares, depending on the environment. # When `rails_report_rescued_exceptions` is true (it is by default), Sentry # will report exceptions even when they are rescued by these middlewares. attr_accessor :report_rescued_exceptions def initialize @report_rescued_exceptions = true end end end end