koa-catch
0.0.3 • Public • Published koa-catch
Catch and re-throw errors via context.throw
Install
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');
});
Package Sidebar
Install
Weekly Downloads