summaryrefslogtreecommitdiff
path: root/lib/opentox.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2013-02-12 22:49:12 +0100
committerChristoph Helma <helma@in-silico.ch>2013-02-12 22:49:12 +0100
commit83f4b12aaacfd27e7019517ac7089ddd912ba259 (patch)
tree7804f50da2c836464717209a316dfcf8432812a2 /lib/opentox.rb
parentfaa7d4a127debbf1a7f31947eccb3a25d5f82240 (diff)
error methods within wait_for_task fixed
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r--lib/opentox.rb5
1 files changed, 2 insertions, 3 deletions
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