From d5a21a29f847afcfee9344554ec5e35dda9f8467 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 21 Oct 2011 15:19:49 -0700 Subject: [PATCH] getaddrinfo returns ENOTFOUND for invalid domain names change test-http-dns-error to reflect this. --- lib/dns.js | 2 +- test/simple/test-http-dns-error.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index c149646981..4be48ee672 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -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; diff --git a/test/simple/test-http-dns-error.js b/test/simple/test-http-dns-error.js index 8f211dafc6..7abdbcf134 100644 --- a/test/simple/test-http-dns-error.js +++ b/test/simple/test-http-dns-error.js @@ -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();