From 83f4b12aaacfd27e7019517ac7089ddd912ba259 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 12 Feb 2013 22:49:12 +0100 Subject: error methods within wait_for_task fixed --- lib/opentox.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/opentox.rb') diff --git a/lib/opentox.rb b/lib/opentox.rb index 050e078..d1e09f6 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -104,7 +104,6 @@ module OpenTox # Save object at webservice def put wait=true # TODO: RDFXML - #append RDF::DC.modified, DateTime.now uri = RestClientWrapper.put @uri.to_s, self.to_ntriples, { :content_type => "text/plain", :subjectid => @subjectid} wait_for_task uri if wait end @@ -123,8 +122,8 @@ module OpenTox t = OpenTox::Task.new uri t.wait unless t.completed? - #TODO raise correct error - #internal_server_error "Task #{uri} failed with #{$!.inspect}" + method = RestClientWrapper.known_errors.select{|error| error[:code] == t.hasStatus.to_i}.first[:method] + Object.send(method,t.message,t.uri) end uri = t.resultURI end -- cgit v1.2.3