|
| 1 | +# chubbyts-http-error |
| 2 | + |
| 3 | +[](https://github.com/chubbyts/chubbyts-http-error/actions?query=workflow%3ACI) |
| 4 | +[](https://coveralls.io/github/chubbyts/chubbyts-http-error?branch=master) |
| 5 | +[](https://dashboard.stryker-mutator.io/reports/github.com/chubbyts/chubbyts-http-error/master) |
| 6 | +[](https://www.npmjs.com/package/@chubbyts/chubbyts-http-error) |
| 7 | + |
| 8 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 9 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 10 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 11 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 12 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 13 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 14 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 15 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 16 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 17 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 18 | +[](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-http-error) |
| 19 | + |
| 20 | +## Description |
| 21 | + |
| 22 | +Creates http error which can be catched and converted to error responses. |
| 23 | + |
| 24 | +## Requirements |
| 25 | + |
| 26 | + * node: 14 |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-http-error][1]. |
| 31 | + |
| 32 | +```ts |
| 33 | +npm i @chubbyts/chubbyts-http-error@^1.0.0 |
| 34 | +``` |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +```ts |
| 39 | +import { createNotFound } from '@chubbyts/chubbyts-http-error/dist/http-error'; |
| 40 | + |
| 41 | +try { |
| 42 | + throw createNotFound({ detail: 'Something went wrong', instance: 'server-1', otherKey: 'otherValue' }); |
| 43 | +} catch (e) { |
| 44 | + console.log(e); |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +## Copyright |
| 49 | + |
| 50 | +Dominik Zogg 2022 |
| 51 | + |
| 52 | +[1]: https://www.npmjs.com/package/@chubbyts/chubbyts-http-error |
| 53 | +[2]: https://web-frameworks-benchmark.netlify.app/result |
| 54 | +[3]: https://www.php-fig.org/psr/psr-15 |
| 55 | +[4]: https://www.npmjs.com/package/@chubbyts/chubbyts-dic-types |
| 56 | +[5]: https://www.npmjs.com/package/@chubbyts/chubbyts-http-types |
| 57 | +[6]: https://www.npmjs.com/package/@chubbyts/chubbyts-log-types |
0 commit comments