# customized-errors

> custom app error

Latest version **1.0.2** (published 2018-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install customized-errors
pnpm add customized-errors
yarn add customized-errors
bun add customized-errors
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-08-15 |
| First published | 2018-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | chuidylan |
| Maintainers | chuidylan |
| Keywords | error, customized-errors, customized |

## Links

- npm: https://www.npmjs.com/package/customized-errors
- Repository: https://github.com/EvanXzj/app-error
- Homepage: https://github.com/EvanXzj/app-error#readme
- Issues: https://github.com/EvanXzj/app-error/issues
- npm.io page: https://npm.io/package/customized-errors

## Dependencies (3)

- [jest](https://npm.io/package/jest.md) ^23.5.0
- [jest-cli](https://npm.io/package/jest-cli.md) ^23.5.0
- [statuses](https://npm.io/package/statuses.md) ^1.5.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

- 1.0.2 (latest) — 2018-08-15
- 1.0.1 — 2018-08-15
- 1.0.0 — 2018-08-15

## README

# app-error
custom app error

## install

```bash
# npm
npm install customized-errors

# yarn
yarn add customized-errors
```

## Test

```bash
npm test

# or with yarn 
yarn run test
```

## usage

```js
const {TooManyRequestsError} = require('./error')

try {
    throw new TooManyRequestsError({message: 'You have exceeded your API rate limit', type: 'E_EXCEEDED_API_RATE_LIMIT', details:{limitCounts: 100, currentRequestCounts: 101}})
} catch (error) {
    console.error(error.message)
    console.log()
    console.error(error)
}

// prints:

// You have exceeded your API rate limit

// { name: 'TooManyRequestsError',
//   code: 'E4429',
//   type: 'E_EXCEEDED_API_RATE_LIMIT',
//   details: { limitCounts: 100, currentRequestCounts: 101 },
//   message: 'You have exceeded your API rate limit',
//   statusCode: 429 }
```

## TODO

1. add test
2. update readme
3. ...

## Dependencies

1. [statuses](https://github.com/jshttp/statuses#readme)

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