Sha256: e8b971980a9ac8f3053d3c74427945c3c3c04047f6a52866eb313f14730c6a77

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 Bytes

Contents

module Rollbar
  # Report any uncaught errors in a job to Rollbar and reraise
  module ActiveJob
    def self.included(base)
      base.send :rescue_from, Exception do |exception|
        args = if self.class.respond_to?(:log_arguments?) && !self.class.log_arguments?
                 arguments.map(&Rollbar::Scrubbers.method(:scrub_value))
               else
                 arguments
               end

        Rollbar.error(exception,
                      :job => self.class.name,
                      :job_id => job_id,
                      :use_exception_level_filters => true,
                      :arguments => args)
        raise exception
      end
    end
  end
end

if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
  ActiveSupport.on_load(:action_mailer) do
    # Automatically add to ActionMailer::DeliveryJob
    if defined?(ActionMailer::DeliveryJob)
      ActionMailer::DeliveryJob.send(:include,
                                     Rollbar::ActiveJob)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rollbar-3.3.3 lib/rollbar/plugins/active_job.rb
rollbar-3.3.2 lib/rollbar/plugins/active_job.rb
rollbar-3.3.1 lib/rollbar/plugins/active_job.rb
rollbar-3.3.0 lib/rollbar/plugins/active_job.rb