diff options
author | Christoph Helma <helma@in-silico.ch> | 2013-02-12 22:49:12 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2013-02-12 22:49:12 +0100 |
commit | 83f4b12aaacfd27e7019517ac7089ddd912ba259 (patch) | |
tree | 7804f50da2c836464717209a316dfcf8432812a2 /lib | |
parent | faa7d4a127debbf1a7f31947eccb3a25d5f82240 (diff) |
error methods within wait_for_task fixed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/opentox.rb | 5 |
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 |