Node util.getSystemErrorMessage function | API Reference | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:util/
getSystemErrorMessageFgetSystemErrorMessage
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:util/
getSystemErrorMessageFgetSystemErrorMessage
function
util.getSystemErrorMessage {
const message = util.getSystemErrorMessage(err.errno);
console.error(message); // no such file or directory
});
```" data-algolia-static="false" data-algolia-merged="false" data-type="Function">function
getSystemErrorMessage(err: number): string;
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
});
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →