From 5cb2d2a78c610291570ce9ffae035e446e030b4b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 18 Sep 2007 11:05:01 +0000 Subject: [PATCH] httputil: promote all Exceptions to RuntimeErrors so they can be caught with inline rescue --- lib/rbot/core/utils/httputil.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rbot/core/utils/httputil.rb b/lib/rbot/core/utils/httputil.rb index 0bc579b1..00164616 100644 --- a/lib/rbot/core/utils/httputil.rb +++ b/lib/rbot/core/utils/httputil.rb @@ -502,6 +502,7 @@ class HttpUtil req.body = opts[:body] if req_class == Net::HTTP::Post debug "prepared request: #{req.to_hash.inspect}" + begin get_proxy(uri, opts).start do |http| http.request(req) do |resp| resp['x-rbot-location'] = uri.to_s @@ -531,6 +532,10 @@ class HttpUtil return handle_response(uri, resp, opts, &block) end end + rescue Exception => e + error e + raise e.message + end end # _uri_:: uri to query (URI object or String) -- 2.39.5