Sha256: e4dac68645ea2349b24f54ec778c6657653025ed78b2df4b634d438add40e47f

Contents?: true

Size: 724 Bytes

Versions: 14

Compression:

Stored size: 724 Bytes

Contents

require 'sidekiq'

# Note: this class is only needed for Sidekiq version < 3.
module ExceptionNotification
  class Sidekiq

    def call(worker, msg, queue)
      begin
        yield
      rescue Exception => exception
        ExceptionNotifier.notify_exception(exception, :data => { :sidekiq => msg })
        raise exception
      end
    end

  end
end

if ::Sidekiq::VERSION < '3'
  ::Sidekiq.configure_server do |config|
    config.server_middleware do |chain|
      chain.add ::ExceptionNotification::Sidekiq
    end
  end
else
  ::Sidekiq.configure_server do |config|
    config.error_handlers << Proc.new { |ex, context|
      ExceptionNotifier.notify_exception(ex, :data => { :sidekiq => context })
    }
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
exception_notification-4.3.0 lib/exception_notification/sidekiq.rb
exception_notification-4.2.2 lib/exception_notification/sidekiq.rb
exception_notification-4.2.1 lib/exception_notification/sidekiq.rb
exception_notification-4.2.0 lib/exception_notification/sidekiq.rb
exception_notification-4.2.0.rc1 lib/exception_notification/sidekiq.rb
exception_notification_more_info-1.0.1 lib/exception_notification/sidekiq.rb
exception_notification_more_info-1.0.0 lib/exception_notification/sidekiq.rb
exception_notification-4.1.4 lib/exception_notification/sidekiq.rb
exception_notification-4.1.3 lib/exception_notification/sidekiq.rb
exception_notification-4.1.2 lib/exception_notification/sidekiq.rb
exception_notification-4.1.1 lib/exception_notification/sidekiq.rb
exception_notification-4.1.0 lib/exception_notification/sidekiq.rb
exception_notification-4.1.0.rc2 lib/exception_notification/sidekiq.rb
exception_notification-4.1.0.rc1 lib/exception_notification/sidekiq.rb