Sha256: 3a7f79ad816311511eb397c7465144b3f1e427c7f1e020c9f6d8eed9f99436de

Contents?: true

Size: 1002 Bytes

Versions: 3

Compression:

Stored size: 1002 Bytes

Contents

module Raven
  class Rails
    module ActiveJob
      def self.included(base)
        base.class_eval do
          rescue_from(Exception) do |exception|
            # Do not capture exceptions when using Sidekiq so we don't capture
            # The same exception twice.
            unless self.class.queue_adapter.to_s == 'ActiveJob::QueueAdapters::SidekiqAdapter'
              active_job_details = {
                :active_job => self.class.name,
                :arguments => arguments,
                :scheduled_at => scheduled_at,
                :job_id => job_id,
                :locale => locale,
              }

              # Add provider_job_id details if Rails 5
              if defined?(provider_job_id)
                active_job_details.merge!(:provider_job_id => provider_job_id)
              end

              Raven.capture_exception(exception, :extra => active_job_details)
              raise exception
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sentry-raven-0.15.3 lib/raven/integrations/rails/active_job.rb
sentry-raven-0.15.2 lib/raven/integrations/rails/active_job.rb
sentry-raven-0.15.1 lib/raven/integrations/rails/active_job.rb