Sha256: 85b63a0767e349c5fa1204d95eece2cef7ff039b5b7b379238d03a9dce27ef78

Contents?: true

Size: 993 Bytes

Versions: 16

Compression:

Stored size: 993 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[: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

16 entries across 16 versions & 1 rubygems

Version Path
sentry-raven-2.5.3 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.5.2 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.5.1 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.5.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.4.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.3.1 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.3.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.2.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.1.4 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.1.3 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.1.2 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.1.1 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.1.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.0.2 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.0.1 lib/raven/integrations/rails/active_job.rb
sentry-raven-2.0.0 lib/raven/integrations/rails/active_job.rb