Sha256: 729c0459f700307dc91eb9e1dd78f26f994086a82c726c4ac59be58e875e22f1

Contents?: true

Size: 525 Bytes

Versions: 2

Compression:

Stored size: 525 Bytes

Contents

module Airbrake
  module Rails
    ##
    # Enables support for exceptions occurring in ActiveJob jobs.
    module ActiveJob
      extend ActiveSupport::Concern

      included do
        rescue_from(Exception) do |exception|
          notice = Airbrake.build_notice(exception)

          notice[:context][:component] = 'active_job'
          notice[:context][:action] = self.class.name

          notice[:params] = as_json

          Airbrake.notify(notice)
          raise exception
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
airbrake-5.2.3 lib/airbrake/rails/active_job.rb
airbrake-5.2.2 lib/airbrake/rails/active_job.rb