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 Application settings are properties on the `app` instance, currently
the following are supported: the following are supported:
- `app.name` optionally give your application a name
- `app.env` defaulting to the __NODE_ENV__ or "development" - `app.env` defaulting to the __NODE_ENV__ or "development"
- `app.proxy` when true proxy header fields will be trusted - `app.proxy` when true proxy header fields will be trusted
- `app.subdomainOffset` offset of `.subdomains` to ignore [2] - `app.subdomainOffset` offset of `.subdomains` to ignore [2]

View file

@ -129,7 +129,7 @@ app.callback = function(){
return function(req, res){ return function(req, res){
var ctx = new self.Context(self, 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){ ctx.socket.on('error', function(err){
self.emit('error', err); self.emit('error', err);
}); });

View file

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