Sha256: 2372e90235541b2cebbf6b10257ecb2062216bbda22aa36eb14c3241c5cd382d
Contents?: true
Size: 1.13 KB
Versions: 9
Compression:
Stored size: 1.13 KB
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." 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 notify( exception, parameters: { payload_class: payload['class'].to_s, payload_args: payload['args'].inspect } ) end private def notify(exception, options) if ::Airbrake.respond_to?(:notify_sync) ::Airbrake.notify_sync(exception, options) else # Older versions of Airbrake (< 5) ::Airbrake.notify(exception, options) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems