Sha256: 5d4d9da3400b6927b5940abfdfa54689669861f13387ad35c16ad0a1bc6b16a9
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
require 'raven/utils/context_filter' module Raven module Sidekiq class ErrorHandler SIDEKIQ_NAME = "Sidekiq".freeze 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 # this will change in the future: # https://github.com/mperham/sidekiq/pull/3161 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 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sentry-raven-3.1.2 | lib/raven/integrations/sidekiq/error_handler.rb |
sentry-raven-3.1.1 | lib/raven/integrations/sidekiq/error_handler.rb |