Class: Checkend::Integrations::Sidekiq::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/checkend/integrations/sidekiq.rb

Overview

Error handler that reports exceptions to Checkend

Instance Method Summary collapse

Instance Method Details

#call(exception, context) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/checkend/integrations/sidekiq.rb', line 50

def call(exception, context)
  return unless Checkend.configuration.valid?

  job_context = extract_job_context(context)

  Checkend.notify(
    exception,
    context: job_context,
    tags: ['sidekiq']
  )
rescue StandardError => e
  Checkend.logger.error("[Checkend] Failed to notify Sidekiq error: #{e.message}")
end