koa-catch

0.0.3 • Public • Published

koa-catch

Catch and re-throw errors via context.throw

Build Status

Install

npm install koa-catch

Usage

var koa = require('koa');
var koaCatch = require('koa-catch');
 
var app = koaCatch(koa());
 
app.use(function *() {
  yield this.catch(function *() {
    throw new Error();
  }, 400, 'Error message');
});

Readme

Keywords

Package Sidebar

Install

npm i koa-catch

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • luin