# @darkwolf/code-error

> Code Error

Latest version **13.21.69** (published 2019-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @darkwolf/code-error
pnpm add @darkwolf/code-error
yarn add @darkwolf/code-error
bun add @darkwolf/code-error
```

## 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 | 13.21.69 |
| Published | 2019-12-20 |
| First published | 2019-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pavel Wolf |
| Maintainers | pavelwolfdark |
| Keywords | code, error |

## Links

- npm: https://www.npmjs.com/package/@darkwolf/code-error
- Repository: https://github.com/darkwolf/code-error
- Homepage: https://github.com/darkwolf/code-error#readme
- Issues: https://github.com/darkwolf/code-error/issues
- npm.io page: https://npm.io/package/@darkwolf/code-error

## 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

- 13.21.69 (latest) — 2019-12-20
- 6.6.6 — 2019-11-26
- 2.1.0 — 2019-11-14
- 2.0.9 — 2019-11-01
- 2.0.8 — 2019-10-26
- 2.0.7 — 2019-10-24
- 2.0.6 — 2019-10-20
- 2.0.4 — 2019-10-20
- 2.0.3 — 2019-09-26
- 2.0.2 — 2019-09-18
- 2.0.1 — 2019-09-03
- 2.0.0 — 2019-09-02
- 1.0.2 — 2019-04-12
- 1.0.1 — 2019-04-11

## README

# Code Error
## Install
```sh
npm i --save @darkwolf/code-error
```
## Usage
```javascript
const CodeError = require('@darkwolf/code-error')

class DarkwolfError extends CodeError {
  constructor(...args) {
    super(...args)
    this.name = 'DarkwolfError'
  }
}

const INVALID_DARKWOLF_ID = new DarkwolfError('invalid-darkwolf-id', 'Invalid Darkwolf ID')

try {
  throw INVALID_DARKWOLF_ID
} catch (e) {
  switch (e.code) {
    case 'invalid-darkwolf-id': {
      break
    }
    default: throw e
  }
}
```
## Init
### new CodeError(code, message)

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