Skip to content

Commit

Permalink
doc: dns.lookup() documentation error code
Browse files Browse the repository at this point in the history
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: nodejs#27604

PR-URL: nodejs#27625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
jvelezpo authored and Trott committed May 13, 2019
1 parent 815b3aa commit fd8d5e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ With the `all` option set to `true`, the arguments for `callback` change to
properties `address` and `family`.

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
such as no available file descriptors.

Expand Down Expand Up @@ -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`
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
such as no available file descriptors.

Expand Down

0 comments on commit fd8d5e7

Please sign in to comment.