Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Honeybadger based error reporting backend for Resque
require 'resque/failure/multiple'
require 'resque/failure/redis'
require 'resque_failure_honeybadger'
Resque::Failure::Multiple.classes = [
Resque::Failure::Redis,
Resque::Failure::Honeybadger
]
Resque::Failure.backend = Resque::Failure::Multiple
# http://gist.github.com/4032446
require "resque"
require "honeybadger"
module Resque
module Failure
class Honeybadger < Base
def configure(&block)
Resque::Failure.backend = self
::Honeybadger.configure(&block)
end
def count
# We can't get the total # of errors from Honeybadger so we
# fake it by asking Resque how many errors it has seen.
Stat[:failed]
end
def save
::Honeybadger.notify_or_ignore(exception,
parameters: {
:payload_class => payload['class'].to_s,
:payload_args => payload['args'].inspect
}
)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment