8000 doc: dns.lookup() documentation error code · nodejs/node@cc45080 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit cc45080

Browse files
jvelezpotargos
authored andcommitted
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: #27604 PR-URL: #27625 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8f48edd commit cc45080

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/dns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ With the `all` option set to `true`, the arguments for `callback` change to
168168
properties `address` and `family`.
169169

170170
On error, `err` is an [`Error`][] object, where `err.code` is the error code.
171-
Keep in mind that `err.code` will be set to `'ENOENT'` not only when
171+
Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
172172
the hostname does not exist but also when the lookup fails in other ways
173173
such as no available file descriptors.
174174

@@ -692,7 +692,7 @@ being an array of objects with the properties `address` and `family`.
692692

693693
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
694694
is the error code.
695-
Keep in mind that `err.code` will be set to `'ENOENT'` not only when
695+
Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
696696
the hostname does not exist but also when the lookup fails in other ways
697697
such as no available file descriptors.
698698

0 commit comments

Comments
 (0)
0