Skip to content

Instantly share code, notes, and snippets.

@JackDanger
Created April 23, 2009 16:45
Show Gist options
  • Save JackDanger/100593 to your computer and use it in GitHub Desktop.
Save JackDanger/100593 to your computer and use it in GitHub Desktop.
Make all Rake (production) errors go to Hoptoadapp.com
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