1.0.0 • Published 1 year ago

@jfabello/common-errors v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Node.js Common Errors Classes

License: MIT

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-errors

Usage

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 classDescription
ERROR_UNKNOWNUnknown 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

1 year ago