From 897ab1f2c3a1e6dd98f9c424f4bcc55420586396 Mon Sep 17 00:00:00 2001 From: Rany Keddo Date: Sat, 31 Jan 2009 20:58:42 +0100 Subject: [PATCH] tweaked logging in case of an exception --- lib/workling/base.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/workling/base.rb b/lib/workling/base.rb index f605c1d..78894d3 100644 --- a/lib/workling/base.rb +++ b/lib/workling/base.rb @@ -39,8 +39,11 @@ def dispatch_to_worker_method(method, options) begin self.send(method, options) rescue Exception => e - raise e if e.kind_of?(Workling::WorklingError) || Workling.raise_exceptions? + raise e if e.kind_of?(Workling::WorklingError) logger.error "WORKLING ERROR: runner could not invoke #{ self.class }:#{ method } with #{ options.inspect }. error was: #{ e.inspect }\n #{ e.backtrace.join("\n") }" + + # reraise after logging. the exception really can't go anywhere in many cases. (spawn traps the exception) + raise e if Workling.raise_exceptions? end end