From 763b868a267099cde66e875ed7d78e01f8bb0cac Mon Sep 17 00:00:00 2001
From: John Dong
Date: Tue, 21 Aug 2007 13:49:04 -0400
Subject: [PATCH] Add a fix for a NoMethodError when WHOIS/DNS server(s) time
out.
---
app/views/quickvote/results.rhtml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 %> |
--
2.39.5