From 32ad3c8f6e1e16cfe9fd59a47df6b560ffb13ddd Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 1 Aug 2012 14:56:08 +0200 Subject: task error handling improved --- lib/rest-client-wrapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/rest-client-wrapper.rb') diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index e89c90d..387a01b 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -17,9 +17,9 @@ module OpenTox # check input @subjectid = headers[:subjectid] ? headers[:subjectid] : nil - bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? 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) + bad_request_error "Invalid URI: '#{uri}'", uri unless URI.valid? uri + #not_found_error "URI '#{uri}' not found.", uri unless URI.accessible?(uri, @subjectid) unless URI.ssl?(uri) + bad_request_error "Headers are not a hash: #{headers.inspect}", uri 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| if defined? $aa || URI(uri).host == URI($aa[:uri]).host -- cgit v1.2.3