From 787c3322e0c1acdccb457c47bea76f31c5747f52 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Thu, 10 Mar 2005 12:11:17 +0000 Subject: fix http usage, other tweaks --- rbot/utils.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rbot/utils.rb') diff --git a/rbot/utils.rb b/rbot/utils.rb index 516fb4dc..36276e8d 100644 --- a/rbot/utils.rb +++ b/rbot/utils.rb @@ -166,18 +166,18 @@ module Irc http.open_timeout = opentimeout http.read_timeout = readtimeout - http.start {|http| - begin + begin + http.start {|http| resp = http.get(query) if resp.code == "200" return resp.body end - rescue => e - # cheesy for now - $stderr.puts "Utils.http_get exception: #{e}, while trying to get #{uristr}" - return nil - end - } + } + rescue => e + # cheesy for now + $stderr.puts "Utils.http_get exception: #{e}, while trying to get #{uristr}" + return nil + end end # This is nasty-ass. I hate writing parsers. -- cgit v1.2.3