-
-
Save henrik/4032446 to your computer and use it in GitHub Desktop.
Honeybadger based error reporting backend for Resque
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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