The Wayback Machine - https://web.archive.org/web/20211206225514/https://github.com/nodejs/node/commit/132425a058
Skip to content
Permalink
Browse files
doc: specify that errno is a number, not a string
The documentation erroneously described the errno property as an alias
for the code property, but that is not the case in the implementation.
errno is the error code of the error as a number, and code is the error
code of the error as a string.

PR-URL: #9007
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
John Vilk authored and Myles Borins committed Nov 11, 2016
1 parent 9a192a9 commit 132425a0587e1371bf5a2e5a2e8a8afdd9166d2c
Showing with 5 additions and 3 deletions.
  1. +5 −3 doc/api/errors.md
@@ -449,13 +449,15 @@ added properties.
### Class: System Error

#### error.code
#### error.errno

Returns a string representing the error code, which is always `E` followed by
a sequence of capital letters, and may be referenced in `man 2 intro`.

The properties `error.code` and `error.errno` are aliases of one another and
return the same value.
#### error.errno

Returns a number corresponding to the **negated** error code, which may be
referenced in `man 2 intro`. For example, an `ENOENT` error has an `errno` of
`-2` because the error code for `ENOENT` is `2`.

#### error.syscall

0 comments on commit 132425a

Please sign in to comment.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.