Module: Delayed::Plugins::Raven::Plugin::Notify

Defined in:
lib/delayed-plugins-raven.rb

Instance Method Summary collapse

Instance Method Details

#error(job, error) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/delayed-plugins-raven.rb', line 10

def error(job, error)
  begin
    ::Raven.capture_exception(error, {
      configuration: ::Delayed::Plugins::Raven.configuration,
      extra: { delayed_job: job.as_json }
    })
  rescue Exception => e
    Rails.logger.error "Raven logging failed: #{e.class.name}: #{e.message}"
    Rails.logger.flush
  end
  super if defined?(super)
end