Creates http error which can be catched and converted to error responses.
- node: 16
Through NPM as @chubbyts/chubbyts-http-error.
npm i @chubbyts/chubbyts-http-error@^2.3.1
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);
}
2024 Dominik Zogg