summaryrefslogtreecommitdiff
path: root/lib/rbot/core/utils
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-18 11:05:01 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-18 11:05:01 +0000
commit5cb2d2a78c610291570ce9ffae035e446e030b4b (patch)
treecbbf30194e55bf7efaf449ed8f9414b8e26ac3a2 /lib/rbot/core/utils
parent2ae1ebd078958ab0b09cf611ec4bea00607e1d91 (diff)
httputil: promote all Exceptions to RuntimeErrors so they can be caught with inline rescue
Diffstat (limited to 'lib/rbot/core/utils')
-rw-r--r--lib/rbot/core/utils/httputil.rb5
1 files changed, 5 insertions, 0 deletions
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)