Sha256: e6af6655daede057da992cb88ad89036344ec5666bc6073701da2e9e53a21a70
Contents?: true
Size: 951 Bytes
Versions: 10
Compression:
Stored size: 951 Bytes
Contents
module Airbrake module Rails ## # Enables support for exceptions occurring in ActiveJob jobs. module ActiveJob extend ActiveSupport::Concern ## # @return [Array<Regexp>] the list of known adapters ADAPTERS = [/Resque/, /Sidekiq/, /DelayedJob/].freeze def self.notify_airbrake(exception, job) queue_adapter = job.class.queue_adapter.to_s # Do not notify twice if a queue_adapter is configured already. raise exception if ADAPTERS.any? { |a| a =~ queue_adapter } Airbrake.notify(exception) do |notice| notice[:context][:component] = 'active_job' notice[:context][:action] = job.class.name notice[:params] = job.serialize end raise exception end included do rescue_from(Exception) do |exception| Airbrake::Rails::ActiveJob.notify_airbrake(exception, self) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems