Class: Airbrake::Shoryuken::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/airbrake/shoryuken.rb

Overview

Provides integration with Shoryuken.

Instance Method Summary collapse

Instance Method Details

#call(worker, queue, _sqs_msg, body, &block) ⇒ Object

rubocop:disable Lint/RescueException



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/airbrake/shoryuken.rb', line 8

def call(worker, queue, _sqs_msg, body, &block)
  timing = Airbrake::Benchmark.measure(&block)
rescue Exception => exception
  notify_airbrake(exception, worker, queue, body)
  Airbrake.notify_queue(
    queue: worker.class.to_s,
    error_count: 1,
    timing: 0.01,
  )
  raise exception
else
  Airbrake.notify_queue(
    queue: worker.class.to_s,
    error_count: 0,
    timing: timing,
  )
end