No description or website provided.
JavaScript
Latest commit bec037f Mar 13, 2013 @baryshev Update version
Failed to load latest commit information.
lib Dispose domain on response finish event Mar 13, 2013
test domain.dispose() before handle next(err) Mar 12, 2013
.gitignore add unittest and coverage Dec 26, 2012
.npmignore
.travis.yml add unittest and coverage Dec 26, 2012
LICENSE First commit Aug 11, 2012
Makefile add unittest and coverage Dec 26, 2012
README.md Remove support of custom error handler Jan 2, 2013
index.js
package.json Update version Mar 13, 2013

README.md

About

Asynchronous error handler for Connect

Installation

npm install connect-domain

Usage

var
    connect = require('connect'),
    connectDomain = require('connect-domain');

var app = connect()
    .use(connectDomain())
    .use(function(req, res){
        if (Math.random() > 0.5) {
            throw new Error('Simple error');
        }
        setTimeout(function() {
            if (Math.random() > 0.5) {
                throw new Error('Asynchronous error from timeout');
            } else {
                res.end('Hello from Connect!');
            }
        }, 1000);
    })
    .use(function(err, req, res, next) {
        res.end(err.message);
    });

app.listen(3000);