class Raven::Sidekiq::ErrorHandler

Constants

SIDEKIQ_NAME

Public Instance Methods

call(ex, context) click to toggle source
# File lib/raven/integrations/sidekiq/error_handler.rb, line 8
def call(ex, context)
  context = Utils::ContextFilter.filter_context(context)
  Raven.context.transaction.push transaction_from_context(context)
  Raven.capture_exception(
    ex,
    :message => ex.message,
    :extra => { :sidekiq => context }
  )
  Context.clear!
  BreadcrumbBuffer.clear!
end

Private Instance Methods

transaction_from_context(context) click to toggle source

this will change in the future: github.com/mperham/sidekiq/pull/3161

# File lib/raven/integrations/sidekiq/error_handler.rb, line 24
def transaction_from_context(context)
  classname = (context["wrapped"] || context["class"] ||
                (context[:job] && (context[:job]["wrapped"] || context[:job]["class"]))
              )
  if classname
    "#{SIDEKIQ_NAME}/#{classname}"
  elsif context[:event]
    "#{SIDEKIQ_NAME}/#{context[:event]}"
  else
    SIDEKIQ_NAME
  end
end