Created
April 23, 2009 16:45
-
-
Save JackDanger/100593 to your computer and use it in GitHub Desktop.
Make all Rake (production) errors go to Hoptoadapp.com
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
namespace :hoptoad do | |
desc "Makes all Rake (production) errors go to Hoptoadapp.com" | |
task :catch do | |
class Rake::Task | |
def execute_with_hoptoad(*args) | |
execute_without_hoptoad(*args) | |
rescue => e | |
require File.expand_path(File.dirname(__FILE__)+'/../../config/environment') | |
HoptoadNotifier.notify e | |
end | |
alias_method_chain :execute, :hoptoad | |
end | |
end | |
end | |
namespace :my_code do | |
task :catch_errors_here_please => 'hoptoad:catch' do | |
raise 'Argh!' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment