Skip to content

Suggested improvements to the name of the temporary variable in the example of util.getSystemErrorMessage #57305

Closed
@IkumaTadokoro

Description

@IkumaTadokoro

Affected URL(s)

https://nodejs.org/api/util.html#utilgetsystemerrormessageerr

Description of the problem

The sample code for util.getSystemErrorMessage is shown below.

fs.access('file/that/does/not/exist', (err) => {
  const name = util.getSystemErrorMessage(err.errno);
  console.error(name);  // No such file or directory
});

The usage and result of this example is correct. But the name actually points to the message. The temporary variable in this example has the same name as util.getSystemErrorName. Therefore, changing name to message would clarify the documentation.

If this suggestion is OK, I will create a PullRequest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions