From 1d49fe0da8e7d4dfc57fdbfffdc4e32db2ef0647 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 2 May 2012 20:06:16 +0000 Subject: initial task service --- lib/rest-client-wrapper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/rest-client-wrapper.rb') 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 -- cgit v1.2.3