From 24ff663908e72dd34de3b24dbf50b86449f1d6d7 Mon Sep 17 00:00:00 2001 From: Alex Young Date: Thu, 16 Apr 2015 10:32:15 +0100 Subject: Catch, log and reraise exceptions in the heartbeat thread --- lib/mauve/heartbeat.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/mauve') 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 -- cgit v1.2.1