Class: ExceptionHunter::Middleware::SidekiqHunter

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_hunter/middleware/sidekiq_hunter.rb

Overview

Middleware to report errors when a Sidekiq worker fails

Constant Summary collapse

TRACK_AT_RETRY =
[0, 3, 6, 10].freeze
JOB_TRACKED_DATA =
%w[
  queue
  retry_count
].freeze
ARGS_TRACKED_DATA =
%w[
  job_class
  job_id
  arguments
  enqueued_at
].freeze

Instance Method Summary collapse

Instance Method Details

#call(_worker, context, _queue) ⇒ Object



18
19
20
21
22
23
# File 'lib/exception_hunter/middleware/sidekiq_hunter.rb', line 18

def call(_worker, context, _queue)
  yield
rescue Exception => exception # rubocop:disable Lint/RescueException
  track_exception(exception, context)
  raise exception
end