koa-error-handler

0.0.0 • Public • Published

koa-error-handler

an error handler for koa, hack ctx.onerror

install

npm install koa-error-handler

Usage

var fs = require('fs');
var koa = require('koa');
var error = require('koa-error-handler');
var app = koa();
 
error(app);
 
app.use(function *(){
  // foo();
  this.body = fs.createReadStream('not exist');
});

Options

error(app, options);
  • all: if options.all exist, ignore negotiation
  • text: text error handler
  • json: json error handler
  • html: html error handler
  • template: default html error handler template path

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i koa-error-handler

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • dead_horse