Smoothly pass errors through your connect application
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package.json

README.md

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)