@code-like-a-carpenter/errors
TypeScript icon, indicating that this package has built-in type declarations

2.2.5 • Public • Published

@code-like-a-carpenter/errors

standard-readme compliant

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

Ian Remmel

Contributing

Please see contributing guidelines at the project homepage.

License

MIT © Ian Remmel 2023 until at least now

Readme

Keywords

none

Package Sidebar

Install

npm i @code-like-a-carpenter/errors

Weekly Downloads

28

Version

2.2.5

License

MIT

Unpacked Size

75.7 kB

Total Files

21

Last publish

Collaborators

  • ianwremmel