Sha256: b1b0719b16e57d40c58b269d9f2f952a52ec0b71ecdde14a1964b392ae5574dd

Contents?: true

Size: 930 Bytes

Versions: 8

Compression:

Stored size: 930 Bytes

Contents

begin
  require 'airbrake'
rescue LoadError
  raise "Can't find 'airbrake' gem. Please add it to your Gemfile or install it."
end

module Resque
  module Failure
    class Airbrake < Base
      def self.configure(&block)
        Resque.logger.warn "This actually sets global Airbrake configuration, " \
          "which is probably not what you want. This will be gone in 2.0."
        Resque::Failure.backend = self
        ::Airbrake.configure(&block)
      end

      def self.count(queue = nil, class_name = nil)
        # We can't get the total # of errors from Airbrake so we fake it
        # by asking Resque how many errors it has seen.
        Stat[:failed]
      end

      def save
        ::Airbrake.notify_or_ignore(exception,
            :parameters => {
            :payload_class => payload['class'].to_s,
            :payload_args => payload['args'].inspect
            }
          )
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/resque-1.26.0/lib/resque/failure/airbrake.rb
resque-1.26.0 lib/resque/failure/airbrake.rb
resque-1.25.2 lib/resque/failure/airbrake.rb
resque-1.26.pre.0 lib/resque/failure/airbrake.rb
resque_signal_from_child-1.25.1 lib/resque/failure/airbrake.rb
resque-1.25.1 lib/resque/failure/airbrake.rb
resque-1.25.0 lib/resque/failure/airbrake.rb
resque-1.25.0.pre lib/resque/failure/airbrake.rb