summaryrefslogtreecommitdiff
path: root/lib/rest-client-wrapper.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-08-01 14:56:08 +0200
committerChristoph Helma <helma@in-silico.ch>2012-08-01 14:56:08 +0200
commit32ad3c8f6e1e16cfe9fd59a47df6b560ffb13ddd (patch)
treea9b36b58e546cb7bbfd2f9f3c4a16de32abbaa9e /lib/rest-client-wrapper.rb
parentfc0397cd0d51df4fe7c23f601c2f211c2ebfbf77 (diff)
task error handling improved
Diffstat (limited to 'lib/rest-client-wrapper.rb')
-rw-r--r--lib/rest-client-wrapper.rb6
1 files changed, 3 insertions, 3 deletions
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