getSystemErrorMessage
Returns the string message for a numeric error code that comes from a Node.js API. The mapping between error codes and string messages is platform-dependent.
fs.access('file/that/does/not/exist', (err) => {
const name = util.getSystemErrorMessage(err.errno);
console.error(name); // no such file or directory
});
Content copied to clipboard
Since
v22.12.0