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');
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.2
    1
  • 0.0.1
    1

Package Sidebar

Install

npm i koa-catch

Weekly Downloads

3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • luin