diff options
author | Alex Young <alex@bytemark.co.uk> | 2015-04-16 10:32:15 +0100 |
---|---|---|
committer | Alex Young <alex@bytemark.co.uk> | 2015-04-16 10:32:15 +0100 |
commit | 24ff663908e72dd34de3b24dbf50b86449f1d6d7 (patch) | |
tree | 3d65b41c0590e9fa1d1f189d574deca114484da9 | |
parent | b5cac76f5f062ddf4179a7220e5df2e655a4ac6a (diff) |
Catch, log and reraise exceptions in the heartbeat thread
-rw-r--r-- | lib/mauve/heartbeat.rb | 10 |
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 |