diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-05-02 20:06:16 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-05-02 20:06:16 +0000 |
commit | 1d49fe0da8e7d4dfc57fdbfffdc4e32db2ef0647 (patch) | |
tree | b8418124dd391965018704986edb39858055d8e7 /lib/rest-client-wrapper.rb | |
parent | f8b6f8d19566d372e47edba7968ce66ff09052c9 (diff) |
initial task service
Diffstat (limited to 'lib/rest-client-wrapper.rb')
-rw-r--r-- | lib/rest-client-wrapper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index 3071432..af1ba42 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -19,7 +19,7 @@ module OpenTox @subjectid = headers[:subjectid] ? headers[:subjectid] : nil bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? uri #TODO fix for internal installations - #not_found_error "URI '#{uri}' not found." unless URI.accessible?(uri, @subjectid) unless URI.ssl?(uri) + not_found_error "URI '#{uri}' not found." unless URI.accessible?(uri, @subjectid) unless URI.ssl?(uri) bad_request_error "Headers are not a hash: #{headers.inspect}" unless headers==nil or headers.is_a?(Hash) # make sure that no header parameters are set in the payload [:accept,:content_type,:subjectid].each do |header| @@ -44,7 +44,9 @@ module OpenTox if [301, 302, 307].include? response.code and request.method == :get response.follow_redirection(request, result) else - raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri + #TODO Reactivate for external services + #raise OpenTox::RestCallError.new response.to_s, request, uri unless response.code < 400 or URI.task? uri + rest_call_error response.to_s, request, uri unless response.code < 400 or URI.task? uri response end end |