Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: document fake ENOTFOUND as a system error #26495

Merged
merged 1 commit into from
Mar 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ program. For a comprehensive list, see the [`errno`(3) man page][].
- `ENOTEMPTY` (Directory not empty): A directory with entries was the target
of an operation that requires an empty directory — usually [`fs.unlink`][].

- `ENOTFOUND` (DNS lookup failed): Indicates a DNS failure of either
`EAI_NODATA` or `EAI_NONAME`. This is not a standard POSIX error.

- `EPERM` (Operation not permitted): An attempt was made to perform an
operation that requires elevated privileges.

Expand Down
4 changes: 2 additions & 2 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ function dnsException(code, syscall, hostname) {
// If `code` is of type number, it is a libuv error number, else it is a
// c-ares error code.
if (typeof code === 'number') {
// FIXME(bnoordhuis) Remove this backwards compatibility nonsense and pass
// the true error to the user. ENOTFOUND is not even a proper POSIX error!
// ENOTFOUND is not a proper POSIX error, but this error has been in place
// long enough that it's not practical to remove it.
if (code === lazyUv().UV_EAI_NODATA || code === lazyUv().UV_EAI_NONAME) {
code = 'ENOTFOUND'; // Fabricated error name.
} else {
Expand Down