M
util.getSystemErrorMessage
History
Added in: v23.1.0, v22.12.0
v23.1.0, v22.12.0
Introduced in: v0.10.0
v0.10.0
util.getSystemErrorMessage(err): string
Attributes
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 message = util.getSystemErrorMessage(err.errno); console.error(message); // No such file or directory });