Sha256: 7e9d9b76bd623d9bff38e934a3ba725085ad465bbfc335ea4f5c036271e70946

Contents?: true

Size: 994 Bytes

Versions: 9

Compression:

Stored size: 994 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

9 entries across 9 versions & 1 rubygems

Version Path
sentry-raven-1.2.3 lib/raven/integrations/rails/active_job.rb
sentry-raven-1.2.2 lib/raven/integrations/rails/active_job.rb
sentry-raven-1.2.1 lib/raven/integrations/rails/active_job.rb
sentry-raven-1.2.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-1.1.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-1.0.0 lib/raven/integrations/rails/active_job.rb
sentry-raven-0.15.6 lib/raven/integrations/rails/active_job.rb
sentry-raven-0.15.5 lib/raven/integrations/rails/active_job.rb
sentry-raven-0.15.4 lib/raven/integrations/rails/active_job.rb