Permalink
Browse files

add try/catch block to profile-list to handle unexpected or strange e…

…rrors
  • Loading branch information...
1 parent f1af0d4 commit 2ab2da3d434d85c986c0d0524ec59645c4cc2186 @jpf committed Dec 23, 2011
Showing with 12 additions and 8 deletions.
  1. +12 −8 profile-list
View
@@ -38,14 +38,18 @@ file.map {|host|
host.chomp!
profile = DomainProfiler.new(host)
- out = {}
- out[:web_host] = profile.dns.a.map{|record| orgname(record.answer) }.lookup(host)
- out[:dns_host] = profile.dns.ns.map{|record| Name.new.shorten(record.answer) }.lookup(host)
- out[:mail_host] = profile.dns.mx.map{|record| Name.new.shorten(record.host) }.lookup(host)
- out[:registrar] = profile.whois.registrar.lookup(host)
- out[:ssl_issuer] = profile.ssl.ca.lookup(host)
- out[:ssl_type] = profile.ssl.cn
- hosts[host] = out
+ begin
+ out = {}
+ out[:web_host] = profile.dns.a.map{|record| orgname(record.answer) }.lookup(host)
+ out[:dns_host] = profile.dns.ns.map{|record| Name.new.shorten(record.answer) }.lookup(host)
+ out[:mail_host] = profile.dns.mx.map{|record| Name.new.shorten(record.host) }.lookup(host)
+ out[:registrar] = profile.whois.registrar.lookup(host)
+ out[:ssl_issuer] = profile.ssl.ca.lookup(host)
+ out[:ssl_type] = profile.ssl.cn
+ hosts[host] = out
+ rescue
+ end
+
}
# Modify this to make stats on hosting provider, dns, mail, whois, ssl, ssn type and count HTML

0 comments on commit 2ab2da3

Please sign in to comment.