From: John Dong Date: Tue, 21 Aug 2007 17:49:04 +0000 (-0400) Subject: Add a fix for a NoMethodError when WHOIS/DNS server(s) time out. X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/763b868a267099cde66e875ed7d78e01f8bb0cac Add a fix for a NoMethodError when WHOIS/DNS server(s) time out. --- diff --git a/app/views/quickvote/results.rhtml b/app/views/quickvote/results.rhtml index 2999e6b..6c1130f 100644 --- a/app/views/quickvote/results.rhtml +++ b/app/views/quickvote/results.rhtml @@ -158,7 +158,7 @@ by several other names.

<% begin %> <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %> <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %> - <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s,true)%> + <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%> <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%> @@ -169,6 +169,10 @@ by several other names.

<%=h err %> <%=h err%> + <% rescue NoMethodError %> + DNS Unreachable + + DNS Unreachable <% end %> <%= voter.vote.votestring %>