lib/sentry/rails/configuration.rb in sentry-rails-4.1.7 vs lib/sentry/rails/configuration.rb in sentry-rails-4.2.0
- old
+ new
@@ -1,10 +1,10 @@
module Sentry
class Configuration
attr_reader :rails
- def post_initialization_callback
+ add_post_initialization_callback do
@rails = Sentry::Rails::Configuration.new
@excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT)
end
end
@@ -21,21 +21,26 @@
'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
+ # Some adapters, like sidekiq, already have their own sentry integration.
+ # In those cases, we should skip ActiveJob's reporting to avoid duplicated reports.
+ attr_accessor :skippable_job_adapters
+
def initialize
@report_rescued_exceptions = true
+ # TODO: Remove this in 4.2.0
+ @skippable_job_adapters = []
end
end
end
end