From b2a2a5783630b524b109300e70db7288ada3ec64 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 10 Oct 2016 12:28:49 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/9007 Reviewed-By: Luigi Pinca Reviewed-By: Gibson Fahnestock --- doc/api/errors.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 5ede6e6e38ea45..28f1858a1ded57 100644 --- a/doc/api/errors.md +++ b/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