fix socket "error" handling

always has clientError now
This commit is contained in:
TJ Holowaychuk 2013-09-08 11:27:16 -07:00
parent 67b49cf82d
commit 02ae4f787d
3 changed files with 3 additions and 2 deletions

View File

@ -38,6 +38,7 @@ http.createServer(app.callback()).listen(3001);
Application settings are properties on the `app` instance, currently
the following are supported:
- `app.name` optionally give your application a name
- `app.env` defaulting to the __NODE_ENV__ or "development"
- `app.proxy` when true proxy header fields will be trusted
- `app.subdomainOffset` offset of `.subdomains` to ignore [2]

View File

@ -129,7 +129,7 @@ app.callback = function(){
return function(req, res){
var ctx = new self.Context(self, req, res);
if (!ctx.socket.listeners('error').length) {
if (1 == ctx.socket.listeners('error').length) {
ctx.socket.on('error', function(err){
self.emit('error', err);
});

View File

@ -578,7 +578,7 @@ module.exports = {
err.status = status || 500;
throw err;
},
/**
* Default error handling.
*