lib/airbrake/sneakers.rb in airbrake-10.0.0 vs lib/airbrake/sneakers.rb in airbrake-10.0.1
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Airbrake
module Sneakers
# Provides integration with Sneakers.
#
# @see https://github.com/jondot/sneakers
@@ -8,15 +10,18 @@
# @return [Array<Symbol>] ignored keys values of which raise
# SystemStackError when `as_json` is called on them
# @see https://github.com/airbrake/airbrake/issues/850
IGNORED_KEYS = %i[delivery_tag consumer channel].freeze
- def call(exception, worker = nil, **context)
+ # rubocop:disable Style/OptionalArguments
+ def call(exception, worker = nil, context)
+ # Later versions add a middle argument.
Airbrake.notify(exception, filter_context(context)) do |notice|
notice[:context][:component] = 'sneakers'
notice[:context][:action] = worker.class.to_s
end
end
+ # rubocop:enable Style/OptionalArguments
private
def filter_context(context)
return context unless context[:delivery_info]