# dmx-error-handler-poc

> Customizable Error Handler Koa APIs

Latest version **0.1.0** (published 2017-02-23) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install dmx-error-handler-poc
pnpm add dmx-error-handler-poc
yarn add dmx-error-handler-poc
bun add dmx-error-handler-poc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-02-23 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Dealer Market Exchange Inc |
| Maintainers | ccowell |
| Keywords | error, handler, microservices, koa |

## Links

- npm: https://www.npmjs.com/package/dmx-error-handler-poc
- npm.io page: https://npm.io/package/dmx-error-handler-poc

## Dependencies (5)

- [fs](https://npm.io/package/fs.md) 0.0.1-security
- [koa](https://npm.io/package/koa.md) ^1.2.5
- [eslint](https://npm.io/package/eslint.md) ^3.16.0
- [throw.js](https://npm.io/package/throw.js.md) ^3.0.1
- [koa-router](https://npm.io/package/koa-router.md) ^5.4.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-02-23

## README

# dmx-error-handler-poc

### Custom Error Handler for Microservices

Create descriptive errors for APIs.

Currenlty supporting preconfigured messages for the following error codes:

| Error Code | Default |
| ---------- | ------- |
| 200 | OK |
| 201 | Created |
| 304 | Not Modified |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal Server Error |


### Installation
``` sh
npm install
npm start
```
1. Navigate to http://localhost:3000 to begin seeing custom error messages

### Watchlist Setup
The error handler currently loads custom error messages from `lib/watch.list` (a CSV file) during initialization.

Sample format for Dealer retrieval:
```sh
/dealer, 304, Dealer Account Not Update
/dealer, 400, Dealer ID is missing
/dealer, 401, Unauthorized Dealer
```

#### Field Description
| Endpoint | Status Code | Custom Message |
| -------- | ----------- | -------------- |
| /dealer | 304 | Dealer Account Not Updated |
| /dealer | 400 | Dealer ID is missing |
| /dealer | 401 | Unauthorized Dealer |


## Todos:

- Modularize the error handler
- Create automated unit tests
- Support endpoints with wildcards

---
_Source: https://npm.io/package/dmx-error-handler-poc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
