2.2.5 • Published 2 months ago
@code-like-a-carpenter/errors v2.2.5
@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