doc: use more clear name in getSystemErrorMessage's example

In the previous example, `name` actually points to the `message`.
So I changed this name to fit the context of the example.

Fixes: https://github.com/nodejs/node/issues/57305
PR-URL: https://github.com/nodejs/node/pull/57310
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
This commit is contained in:
ikuma-t authored and jakecastelli committed 2025-03-07 15:58:12 +10:30
1 parent 117c1ca9eb
commit 8032e96cc8
1 file changed
+2 -2
+2 -2
View File
@@ -668,8 +668,8 @@ The mapping between error codes and string messages is platform-dependent.
```js
fs.access('file/that/does/not/exist', (err) => {
const name = util.getSystemErrorMessage(err.errno);
console.error(name); // No such file or directory
const message = util.getSystemErrorMessage(err.errno);
console.error(message); // No such file or directory
});
```