diff options
author | Micha Rautenberg <mr@mrautenberg.de> | 2015-10-30 14:08:56 +0100 |
---|---|---|
committer | Micha Rautenberg <mr@mrautenberg.de> | 2015-10-30 14:08:56 +0100 |
commit | 2081bda2b72f34758847fe699fecf890dae1e3df (patch) | |
tree | 891e78bad5e935546d4e0a39175c4c7c9b96603c /lib/rest-client-wrapper.rb | |
parent | ba2f5c56cb7bb93e41e1bb6b4a447fd8d1d5955f (diff) |
error methods do only accept 1 argument
Diffstat (limited to 'lib/rest-client-wrapper.rb')
-rw-r--r-- | lib/rest-client-wrapper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rest-client-wrapper.rb b/lib/rest-client-wrapper.rb index 60775e3..6b5d602 100644 --- a/lib/rest-client-wrapper.rb +++ b/lib/rest-client-wrapper.rb @@ -26,15 +26,15 @@ module OpenTox define_singleton_method method do |uri,payload={},headers={},waiting_task=nil| # check input - bad_request_error "Headers are not a hash: #{headers.inspect}", uri unless headers==nil or headers.is_a?(Hash) + bad_request_error "Headers are not a hash: #{headers.inspect} for #{uri}." unless headers==nil or headers.is_a?(Hash) headers[:subjectid] ||= @@subjectid - bad_request_error "Invalid URI: '#{uri}'", uri unless URI.valid? uri + bad_request_error "Invalid URI: '#{uri}'" unless URI.valid? uri #resource_not_found_error "URI '#{uri}' not found.", uri unless URI.accessible?(uri, @subjectid) unless URI.ssl?(uri) # 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 else - bad_request_error "#{header} should be submitted in the headers", uri if payload and payload.is_a?(Hash) and payload[header] + bad_request_error "#{header} should be submitted in the headers of URI: #{uri}" if payload and payload.is_a?(Hash) and payload[header] end end |