From 01856c1edf64ca1f33e2c3c99e539f48d3d19dda Mon Sep 17 00:00:00 2001 From: mguetlein Date: Mon, 4 Feb 2013 17:39:56 +0100 Subject: add pending fix to log non-runtime-errors --- lib/task.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/task.rb') diff --git a/lib/task.rb b/lib/task.rb index 23e6e9e..315dc18 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -18,7 +18,16 @@ module OpenTox begin result_uri = yield task.completed result_uri - rescue + rescue + unless $!.is_a?(RuntimeError) # PENDING: only runtime Errors are logged when raised + cut_index = $!.backtrace.find_index{|line| line.match /gems\/sinatra/} + msg = "\nTask ERROR\n"+ + "task description: #{params[RDF::DC.description]}\n"+ + "task uri: #{$!.class.to_s}\n"+ + "error msg: #{$!.message}\n"+ + "error backtrace:\n#{$!.backtrace[0..cut_index].join("\n")}\n" + $logger.error msg + end if $!.respond_to? :to_ntriples RestClientWrapper.put(File.join(task.uri,'Error'),:errorReport => $!.to_ntriples,:content_type => 'text/plain') else -- cgit v1.2.3