Kane Error
Error handler for the Kane API.
Requirements
You need to execute node
version 8.x
at least (async/await
).
Installation
# 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:
const Koa = ;const koaErrorHandler = ; const app = ;app;
Koa Custom Error
This is an utility object that incorporate the HTTP status to send back to the user:
const KaneError = ; throw 418 "I'm a teapot!";
Linting
Made using eslint
. To enforce rules to be applied, use yarn lint:fix
.