node-dns icon indicating copy to clipboard operation
node-dns copied to clipboard

uncaughtException in reverse

Open zarmack opened this issue 10 years ago • 1 comments

Hi,

When I'm triing to make a reverse lookup to a dns server (tinydns) and doesn't respond, native-dns drops an uncaughtException that isn't caught by the try / catch. The error is:

events.js:72 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:904:11) at Object.afterConnect [as oncomplete] (net.js:895:19)

The code that generates the error, is:

var remoteip = 8.8.8.8; ndns.platform.timeout = 500; ndns.platform.name_servers.length = 0; ndns.platform.name_servers.push({address: '178.62.48.121', port: 53, type: "udp"});

try { var dreq = ndns.reverse(remoteip, function(error, result) { if(error) { callback(error, null); } else callback(null, true); }); } catch(error) { console.log(error); callback(error, null); }

Best regards, Zarmack

zarmack avatar Aug 14 '15 14:08 zarmack

Did you have error and socketError handlers attached?

coolaj86 avatar Nov 18 '15 05:11 coolaj86