From f1427740caae90a68811f217b49abc9a4e4ad503 Mon Sep 17 00:00:00 2001 From: Valentin Krasontovitsch Date: Wed, 8 Nov 2017 10:40:56 +0100 Subject: [PATCH] Report connection errors to sentry When the hutch runner fails due to a connection, authentication or worker setup error, the exception is only logged. With this change the exception is reported with all available error handlers. Closes #288 --- lib/hutch/cli.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/hutch/cli.rb b/lib/hutch/cli.rb index 681e28ea..dfc26165 100644 --- a/lib/hutch/cli.rb +++ b/lib/hutch/cli.rb @@ -90,6 +90,12 @@ def start_work_loop @worker.run :success rescue ConnectionError, AuthenticationError, WorkerSetupError => ex + dummy_props = Class.new do + attr_accessor :message_id + end + Hutch::Config[:error_handlers].each do |backend| + backend.handle(dummy_props.new, {}, nil, ex) + end logger.fatal ex.message :error end