Skip to content

Commit

Permalink
catches timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
opencongress committed Oct 5, 2011
1 parent db94180 commit 7acfbac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/commentary_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,11 @@ def CommentaryParser.get_body_for_host_and_path(host, path)
response = nil;
Net::HTTP::Proxy(use_proxy[0], use_proxy[1]).start(host) do |http|
request = Net::HTTP::Get.new(path, {"User-Agent" => USERAGENT})
response = http.request(request) rescue nil
begin
response = http.request(request)
rescue Timeout::Error
response = nil
end
end
end while !response.kind_of? Net::HTTPSuccess
@@proxy = use_proxy if @@proxy.nil?
Expand Down

0 comments on commit 7acfbac

Please sign in to comment.