chubbyts-http-error
Description
Creates http error which can be catched and converted to error responses.
Requirements
- node: 16
Installation
Through NPM as @chubbyts/chubbyts-http-error.
npm i @chubbyts/chubbyts-http-error@^2.3.1
Usage
import { createNotFound } from '@chubbyts/chubbyts-http-error/dist/http-error';
try {
throw createNotFound({ detail: 'Something went wrong', instance: 'server-1', otherKey: 'otherValue' });
} catch (e) {
console.log(e);
}
Copyright
2023 Dominik Zogg