getaddrinfo returns ENOTFOUND for invalid domain names

change test-http-dns-error to reflect this.
This commit is contained in:
Ryan Dahl 2011-10-21 15:19:49 -07:00
parent efa95c2718
commit d5a21a29f8
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ function errnoException(errorno, syscall) {
// For backwards compatibility. libuv returns ENOENT on NXDOMAIN.
if (errorno == 'ENOENT') {
errorno = 'EBADNAME'
errorno = 'ENOTFOUND'
}
e.errno = e.code = errorno;

View File

@ -46,14 +46,14 @@ function test(mod) {
// Ensure that there is time to attach an error listener.
var req = mod.get({host: host, port: 42}, do_not_call);
req.on('error', function(err) {
assert.equal(err.code, 'EBADNAME');
assert.equal(err.code, 'ENOTFOUND');
actual_bad_requests++;
});
// http.get() called req.end() for us
var req = mod.request({method: 'GET', host: host, port: 42}, do_not_call);
req.on('error', function(err) {
assert.equal(err.code, 'EBADNAME');
assert.equal(err.code, 'ENOTFOUND');
actual_bad_requests++;
});
req.end();