Common errors usable across projects
npm install @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.
- Install
- Usage
- Maintainer
- Contributing
- License
``bash`
npm i @code-like-a-carpenter/errors
`ts
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;
}
``
Please see contributing guidelines at the
project homepage.
MIT © Ian Remmel 2023 until at least now