diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-04-23 14:45:48 +0200 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-04-23 14:45:48 +0200 |
commit | 08232976c35511086fe6787c6c8c098c63ef0818 (patch) | |
tree | a153cac4b42206d6e4ace0bb3a14f90cfdcc79bb /lib/rest_client_wrapper.rb | |
parent | ad974c419a2efe4c0ceaa1f3e2346906b5783e52 (diff) |
minor fixes
Diffstat (limited to 'lib/rest_client_wrapper.rb')
-rw-r--r-- | lib/rest_client_wrapper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rest_client_wrapper.rb b/lib/rest_client_wrapper.rb index 5a6362b..86ee890 100644 --- a/lib/rest_client_wrapper.rb +++ b/lib/rest_client_wrapper.rb @@ -85,6 +85,7 @@ module OpenTox do_halt 400,"uri is null",uri,headers,payload unless uri do_halt 400,"not a uri",uri,headers,payload unless Utils.is_uri?(uri) do_halt 400,"headers are no hash",uri,headers,payload unless headers==nil or headers.is_a?(Hash) + do_halt 400,"nil headers for post not allowed, use {}",uri,headers,payload if rest_call=="post" and headers==nil headers.each{ |k,v| headers.delete(k) if v==nil } if headers #remove keys with empty values, as this can cause problems begin @@ -131,6 +132,7 @@ module OpenTox task.wait_for_completion raise task.description if task.error? res = WrapperResult.new(task.resultURI) + LOGGER.debug "task resultURI "+res.to_s res.content_type = "text/uri-list" end return res @@ -140,7 +142,8 @@ module OpenTox rescue RestClient::RequestTimeout => ex do_halt 408,ex.message,uri,headers,payload rescue => ex - #raise ex.message+" uri: "+uri.to_s + #raise ex + #raise "'"+ex.message+"' uri: "+uri.to_s begin code = ex.http_code msg = ex.http_body |