summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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