catch dns api error
This commit is contained in:
parent
8207cc91b2
commit
7ba1914300
1 changed files with 8 additions and 4 deletions
|
|
@ -301,10 +301,14 @@ function setup(req, res, next) {
|
|||
// prevent overlapping lookups
|
||||
// for the same address
|
||||
rec.host = 'unknown';
|
||||
dns.reverse(ipaddr,(err,addr) => {
|
||||
rec.host = addr;
|
||||
// if (addr) log({ip:ipaddr, addr:addr});
|
||||
});
|
||||
try {
|
||||
dns.reverse(ipaddr, (err,addr) => {
|
||||
rec.host = addr;
|
||||
// if (addr) log({ip:ipaddr, addr:addr});
|
||||
});
|
||||
} catch (e) {
|
||||
console.log({dns_err: e, ipaddr})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue