Skip to content

Commit 414ad11

Browse files
cjihrigBridgeAR
authored andcommitted
doc: document fake ENOTFOUND as a system error
PR-URL: #26495 Fixes: #26484 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7323ffb commit 414ad11

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: doc/api/errors.md

+3
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ program. For a comprehensive list, see the [`errno`(3) man page][].
573573
- `ENOTEMPTY` (Directory not empty): A directory with entries was the target
574574
of an operation that requires an empty directory — usually [`fs.unlink`][].
575575

576+
- `ENOTFOUND` (DNS lookup failed): Indicates a DNS failure of either
577+
`EAI_NODATA` or `EAI_NONAME`. This is not a standard POSIX error.
578+
576579
- `EPERM` (Operation not permitted): An attempt was made to perform an
577580
operation that requires elevated privileges.
578581

Diff for: lib/internal/errors.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ function dnsException(code, syscall, hostname) {
432432
// If `code` is of type number, it is a libuv error number, else it is a
433433
// c-ares error code.
434434
if (typeof code === 'number') {
435-
// FIXME(bnoordhuis) Remove this backwards compatibility nonsense and pass
436-
// the true error to the user. ENOTFOUND is not even a proper POSIX error!
435+
// ENOTFOUND is not a proper POSIX error, but this error has been in place
436+
// long enough that it's not practical to remove it.
437437
if (code === lazyUv().UV_EAI_NODATA || code === lazyUv().UV_EAI_NONAME) {
438438
code = 'ENOTFOUND'; // Fabricated error name.
439439
} else {

0 commit comments

Comments
 (0)