Created
July 27, 2012 19:33
-
-
Save mergulhao/3190051 to your computer and use it in GitHub Desktop.
DelayJob with Airbrake exception catch
This file contains 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
class BaseJob < Struct.new(:params) | |
def perform | |
send(params[:action]) | |
rescue Exception => exception | |
Airbrake.notify(exception, { | |
api_key: ENV['AIRBRAKE_API_KEY'] | |
}) | |
raise exception | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment