1.0.0 • Published 12 months ago
@jfabello/common-errors v1.0.0
Node.js Common Errors Classes
A simple Node.js module that provides common error classes.
Table of Contents
Installation
You can install this module via npm:
npm install @jfabello/common-errorsUsage
After installation, import the module and use the common errors classes in your application:
const commonErrors = require("@jfabello/common-errors");
try {
// Some code that may fail
} catch (error) {
if (error.code === "EACCES") {
// Handle this known error
} else {
// Throw the ERROR_UNKNOWN common error
throw new commonErrors.ERROR_UNKNOWN();
}
}Common Errors Classes
The following common errors classes are available:
| Error class | Description |
|---|---|
ERROR_UNKNOWN | Unknown error |
Contributing
Unfortunately, we are not able to accept contributions at this time.
If you find a bug in the code, please open an issue.
Thank you for your understanding.
License
This project is licensed under the MIT License. See the LICENSE file for details.
1.0.0
12 months ago