doc: dns.lookup() documentation error code

dns.lookup() will always return ENOTFOUND on a empty lookup
or when the host not found.
https://github.com/nodejs/node/blob/master/lib/internal/errors.js#L503

Fixes: https://github.com/nodejs/node/issues/27604

PR-URL: https://github.com/nodejs/node/pull/27625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
jvelezpo 2019-05-09 10:07:22 -05:00 committed by Rich Trott
parent 815b3aa833
commit fd8d5e7d9e

View File

@ -168,7 +168,7 @@ With the `all` option set to `true`, the arguments for `callback` change to
properties `address` and `family`. properties `address` and `family`.
On error, `err` is an [`Error`][] object, where `err.code` is the error code. On error, `err` is an [`Error`][] object, where `err.code` is the error code.
Keep in mind that `err.code` will be set to `'ENOENT'` not only when Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
the hostname does not exist but also when the lookup fails in other ways the hostname does not exist but also when the lookup fails in other ways
such as no available file descriptors. such as no available file descriptors.
@ -692,7 +692,7 @@ being an array of objects with the properties `address` and `family`.
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
is the error code. is the error code.
Keep in mind that `err.code` will be set to `'ENOENT'` not only when Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
the hostname does not exist but also when the lookup fails in other ways the hostname does not exist but also when the lookup fails in other ways
such as no available file descriptors. such as no available file descriptors.