Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 3.7 KB

README.md

File metadata and controls

57 lines (42 loc) · 3.7 KB

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