@code-like-a-carpenter/errors
v2.4.0
Published
Common errors usable across projects
Downloads
96
Readme
@code-like-a-carpenter/errors
Common errors usable across projects
At present, this package contains the http errors based MDN's list of HTTP status codes.
Table of Contents
Install
npm i @code-like-a-carpenter/errors
Usage
import {NotFound} from '@code-like-a-carpenter/errors';
try {
const result = loadFromDatabase();
} catch (err) {
if (err.message === 'NoSuchRecord') {
throw new NotFound('Could not find resource', {cause: err});
}
throw err;
}
Maintainer
Contributing
Please see contributing guidelines at the project homepage.
License
MIT © Ian Remmel 2023 until at least now