summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Milon <danmilon@gmail.com>2013-01-18 02:40:48 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-01-18 12:13:32 +0100
commit7295bb9435c10fe569d36e64d50769fed4b5d7e3 (patch)
tree44f060328520b64d4a2800049b3eacafd429b7ea /lib
parent31583be04218c49d91440a58969dbfc4f5f7b472 (diff)
downloadnode-new-7295bb9435c10fe569d36e64d50769fed4b5d7e3.tar.gz
dns: make error message match errno
Diffstat (limited to 'lib')
-rw-r--r--lib/dns.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dns.js b/lib/dns.js
index bd7789c6fa..fb7a8138c1 100644
--- a/lib/dns.js
+++ b/lib/dns.js
@@ -28,13 +28,14 @@ function errnoException(errorno, syscall) {
// TODO make this more compatible with ErrnoException from src/node.cc
// Once all of Node is using this function the ErrnoException from
// src/node.cc should be removed.
- var e = new Error(syscall + ' ' + errorno);
// For backwards compatibility. libuv returns ENOENT on NXDOMAIN.
if (errorno == 'ENOENT') {
errorno = 'ENOTFOUND';
}
+ var e = new Error(syscall + ' ' + errorno);
+
e.errno = e.code = errorno;
e.syscall = syscall;
return e;