diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-08-01 14:56:08 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-08-01 14:56:08 +0200 |
commit | 32ad3c8f6e1e16cfe9fd59a47df6b560ffb13ddd (patch) | |
tree | a9b36b58e546cb7bbfd2f9f3c4a16de32abbaa9e /lib/task.rb | |
parent | fc0397cd0d51df4fe7c23f601c2f211c2ebfbf77 (diff) |
task error handling improved
Diffstat (limited to 'lib/task.rb')
-rw-r--r-- | lib/task.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/task.rb b/lib/task.rb index 0b0aea2..42bc84b 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -47,7 +47,7 @@ module OpenTox def kill Process.kill(9,@pid) Process.kill(9,@observer_pid) - rescue # no need to raise an exeption if processes are not running + rescue # no need to raise an exception if processes are not running end def description @@ -82,7 +82,6 @@ module OpenTox dur = [[(Time.new - start_time)/20.0,0.3].max,300.0].min time_out_error "max wait time exceeded ("+DEFAULT_TASK_MAX_DURATION.to_s+"sec), task: '"+@uri.to_s+"'" if (Time.new > due_to_time) end - get end end @@ -114,6 +113,20 @@ module OpenTox end end + def error_report + report = {} + query = RDF::Query.new({ + :report => { + RDF.type => RDF::OT.ErrorReport, + :property => :value, + } + }) + query.execute(@rdf).each do |solution| + report[solution.property] = solution.value.to_s + end + report + end + #TODO: subtasks (only for progress) end |