Socket
Book a DemoInstallSign in
Socket

koa-errors

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-errors

Rails-inspired error handler for Koa applications

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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.

Keywords

koa

FAQs

Package last updated on 13 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts