aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Young <alex@bytemark.co.uk>2015-04-16 10:32:15 +0100
committerAlex Young <alex@bytemark.co.uk>2015-04-16 10:32:15 +0100
commit24ff663908e72dd34de3b24dbf50b86449f1d6d7 (patch)
tree3d65b41c0590e9fa1d1f189d574deca114484da9
parentb5cac76f5f062ddf4179a7220e5df2e655a4ac6a (diff)
Catch, log and reraise exceptions in the heartbeat thread
-rw-r--r--lib/mauve/heartbeat.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mauve/heartbeat.rb b/lib/mauve/heartbeat.rb
index d07e6fc..9c0b133 100644
--- a/lib/mauve/heartbeat.rb
+++ b/lib/mauve/heartbeat.rb
@@ -104,8 +104,14 @@ module Mauve
update.alert << message
- Mauve::Sender.new(self.destination).send(update)
- logger.debug "Sent to #{self.destination}"
+ begin
+ Mauve::Sender.new(self.destination).send(update)
+ logger.debug "Sent to #{self.destination}"
+ rescue => e
+ logger.error "Caught #{e.class}: #{e.message}"
+ logger.debug e.backtrace.join("\n")
+ raise
+ end
sleep @send_every
end