connect-error

Smoothly pass errors through your connect application

npm install connect-error
64 downloads in the last week
201 downloads in the last month

connect-error

Smoothly pass errors through your connect application.

example

First of all install this module with npm install connect-error.

var connect = require('connect'),
    connectError = require('connect-error');

app = connect()
  .use(connectError())
  .use(function (req, res) {
    // create a correct error object and pass it to our error handler
    res.error('example error');
  })
  .use(function (err, req, res, next) {
    // err is a clean `Error` instance with a `stack` property.
    // application flow will jump directly to this error handler.
  })
  .listen(3000);

todo

  • Add filter support for whenever errors appear (allow airbreak, string manipulation and substitution or other things)
npm loves you