From 9b9fba4ecad1766d5f2c08b741e20da26780a63b Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 13 Sep 2011 05:40:08 +0800 Subject: [PATCH] If hoptoad crashes, it doesn't send any more errors. Rescuing just makes it harder to debug --- lib/overrides/hoptoad_notifier/hoptoad_notifier.rb | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb b/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb index d148514..89ffca6 100644 --- a/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb +++ b/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb @@ -8,20 +8,16 @@ HoptoadNotifier.module_eval do def send_notice(notice) # Log the error internally if we are not in a development environment. if configuration.public? - begin - app = App.find_or_initialize_by(:name => "Self.Errbit") - if app.new? - app.github_url = "https://github.com/errbit/errbit.git" - app.save! - end - notice.send("api_key=", app.api_key) - # Create notice internally. - # 'to_xml ~> from_xml' provides a data bridge between hoptoad_notifier and Errbit. - ::Notice.from_xml(notice.to_xml) - logger.info "Internal error was logged to 'Self.Errbit' app." - rescue - logger.error "-- Errbit crashed while processing an internal error!" if logger + app = App.find_or_initialize_by(:name => "Self.Errbit") + if app.new? + app.github_url = "https://github.com/errbit/errbit.git" + app.save! end + notice.send("api_key=", app.api_key) + # Create notice internally. + # 'to_xml ~> from_xml' provides a data bridge between hoptoad_notifier and Errbit. + ::Notice.from_xml(notice.to_xml) + logger.info "Internal error was logged to 'Self.Errbit' app." end end end -- libgit2 0.21.2