Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncaughtException in reverse #103

Open
zarmack opened this issue Aug 14, 2015 · 1 comment
Open

uncaughtException in reverse #103

zarmack opened this issue Aug 14, 2015 · 1 comment

Comments

@zarmack
Copy link

zarmack commented Aug 14, 2015

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

@coolaj86
Copy link
Contributor

Did you have error and socketError handlers attached?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants