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: #27604

PR-URL: #27625
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
jvelezpo authored and targos committed May 14, 2019
1 parent 8f48edd commit cc45080
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 cc45080

Please sign in to comment.