Skip to content

chubbyts/chubbyts-http-error

Repository files navigation

chubbyts-http-error

CI Coverage Status Mutation testing badge npm-version

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

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

2024 Dominik Zogg

About

Creates http error which can be catched and converted to error responses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published