Sha256: 44ce39112de65ab4e0d3a812222960b8a00796cd026c5a0601047e5936330fb5

Contents?: true

Size: 914 Bytes

Versions: 3

Compression:

Stored size: 914 Bytes

Contents

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

module ResqueAdmin
  module Failure
    class Airbrake < Base
      def self.configure(&block)
        ResqueAdmin.logger.warn "This actually sets global Airbrake configuration, " \
          "which is probably not what you want."
        ResqueAdmin::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 ResqueAdmin how many errors it has seen.
        Stat[:failed]
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
resque_admin-1.0.5 lib/resque_admin/failure/airbrake.rb
resque_admin-0.2.0 lib/resque_admin/failure/airbrake.rb
resque_admin-2.4.4 lib/resque_admin/failure/airbrake.rb