Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…rrors
  • Loading branch information...
commit 2ab2da3d434d85c986c0d0524ec59645c4cc2186 1 parent f1af0d4
@jpf authored
Showing with 12 additions and 8 deletions.
  1. +12 −8 profile-list
View
20 profile-list
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.