koa-errors

1.0.1 • Public • Published

koa-errors

Koa middleware for displaying Rails-inspired error pages for development environments with error name, message, stack trace and extracted code around source of error.

Note: It does not swallow errors, they still get the same usual output in the console.

Tip: Looking for express version?

Installation

$ npm install koa-errors --save

Usage

var koa = require('koa');
var errors = require('koa-errors');
 
var app = koa();
 
app.use(errors());
app.use(function * (next) {
  throw new Error('Oh no, the world is coming to an end!');
  
  this.body = 'No way!';
  
  yield next;
});
 
app.listen(3000);

License

koa-errors is released under the MIT license.

Package Sidebar

Install

npm i koa-errors

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vdemedes