# kane-error

> Handling errors for the Kane API

Latest version **0.6.5** (published 2018-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install kane-error
pnpm add kane-error
yarn add kane-error
bun add kane-error
```

## 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.6.5 |
| Published | 2018-11-22 |
| First published | 2018-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.x |
| Dependencies | 3 |
| Unpacked size | 31.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nomad Education |
| Maintainers | nomad-education-developer |
| Keywords | node, koa, kane, error-handler |

## Links

- npm: https://www.npmjs.com/package/kane-error
- npm.io page: https://npm.io/package/kane-error

## Dependencies (3)

- [strip-ansi](https://npm.io/package/strip-ansi.md) ^5.0.0
- [@sentry/node](https://npm.io/package/@sentry/node.md) ^4.3.0
- [kane-api-utils](https://npm.io/package/kane-api-utils.md) ^0.3.7

## 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.6.5 (latest) — 2018-11-22
- 0.6.4 — 2018-11-20
- 0.6.3 — 2018-11-19
- 0.6.2 — 2018-11-13
- 0.6.1 — 2018-11-13
- 0.6.0 — 2018-11-13
- 0.5.0 — 2018-11-12
- 0.4.1 — 2018-11-05
- 0.4.0 — 2018-09-19
- 0.3.5 — 2018-09-19
- 0.3.4 — 2018-09-14
- 0.3.3 — 2018-09-14
- 0.3.2 — 2018-09-14
- 0.3.1 — 2018-09-14
- 0.3.0 — 2018-09-14
- … 1 more at https://npm.io/package/kane-error/versions

## README

# Kane Error
[![Known Vulnerabilities](https://snyk.io/test/npm/kane-error/badge.svg)](https://snyk.io/test/npm/kane-error)

Error handler for the Kane API.

## Requirements

You need to execute `node` version `8.x` **at least** (`async/await`).

## Installation

```bash
# npm
npm install --save kane-error
# yarn
yarn add kane-error
```

## Usage

### Koa middleware

A simple error handler that log unhandled exceptions and send a standard "message" back to the user:
```js
const Koa = require("koa");
const {koaErrorHandler} = require("kane-error");

const app = new Koa();
app.use(koaErrorHandler());
```

### Koa Custom Error

This is an utility object that incorporate the HTTP status to send back to the user:
```js
const {KaneError} = require("kane-error");

throw new KaneError(418, "I'm a teapot!");
```

### Linting

Made using `eslint`. To enforce rules to be applied, use `yarn lint:fix`.

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