Improved error handling.
This commit is contained in:
parent
9d53f977e5
commit
f57383436f
1 changed files with 8 additions and 3 deletions
|
@ -846,9 +846,14 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
end
|
end
|
||||||
|
|
||||||
def mxers(domain)
|
def mxers(domain)
|
||||||
mxs = Resolv::DNS.open do |dns|
|
begin
|
||||||
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
|
mxs = Resolv::DNS.open do |dns|
|
||||||
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] }
|
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
|
||||||
|
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] }
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
logger.error e.message
|
||||||
|
logger.error e.backtrace.inspect
|
||||||
end
|
end
|
||||||
mxs
|
mxs
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue