Skip to content
Closed
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
doc: 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.
  • Loading branch information
John Vilk committed Oct 10, 2016
commit a554d5914f1aaab2cf00b26eaa15cc07b77f437f
8 changes: 5 additions & 3 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down