Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 132425a

Browse filesBrowse files
John VilkMyles Borins
authored andcommitted
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>
1 parent 9a192a9 commit 132425a
Copy full SHA for 132425a

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+5-3Lines changed: 5 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,15 @@ added properties.
449449
### Class: System Error
450450

451451
#### error.code
452-
#### error.errno
453452

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

457-
The properties `error.code` and `error.errno` are aliases of one another and
458-
return the same value.
456+
#### error.errno
457+
458+
Returns a number corresponding to the **negated** error code, which may be
459+
referenced in `man 2 intro`. For example, an `ENOENT` error has an `errno` of
460+
`-2` because the error code for `ENOENT` is `2`.
459461

460462
#### error.syscall
461463

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.