app.on( 'error', function(e) { ... }) not work #749

tlindig opened this Issue Feb 14, 2013 · 1 comment


None yet
2 participants

tlindig commented Feb 14, 2013

I want handle EADDRINUSE how it is described in API Doc nodejs but connect/express did not call the error event handler.

here is a example:

var connect = require('connect');
var app = connect();

app.use(function(req, res){
    res.end('hello world\n');

app.on( 'error' , function(e) {
    console.log('error event handler called');


if I start the server two times, I got
throw arguments[1]; // Unhandled 'error' event

Is this a bug?

I tested it with connect 2.7.2.


tj commented Feb 14, 2013

connect 2.x is a function now not a net.Server, so when you do app.listen() it returns a net.Server:

var server = app.listen(3000);


tj closed this Feb 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment