From 92b741ac0a83d1608a5b4cd397c30a8f180cc86b Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sun, 8 Sep 2013 11:44:45 -0700 Subject: [PATCH] remove socket error handling, use server "clientError" --- lib/application.js | 6 ------ test/application.js | 21 --------------------- 2 files changed, 27 deletions(-) diff --git a/lib/application.js b/lib/application.js index 9c70938..4b9b5c3 100644 --- a/lib/application.js +++ b/lib/application.js @@ -129,12 +129,6 @@ app.callback = function(){ return function(req, res){ var ctx = new self.Context(self, req, res); - if (1 == ctx.socket.listeners('error').length) { - ctx.socket.on('error', function(err){ - self.emit('error', err); - }); - } - co.call(ctx, function *(){ yield fn; }, function(err){ diff --git a/test/application.js b/test/application.js index 47627fd..be5ebba 100644 --- a/test/application.js +++ b/test/application.js @@ -204,27 +204,6 @@ describe('app.respond', function(){ }) }) - describe('when a socket error occurs', function(){ - it('should emit "error" on the app', function(done){ - var app = koa(); - - app.use(function(next){ - return function *(){ - this.socket.emit('error', new Error('tobi escaped')); - } - }); - - app.on('error', function(err){ - err.message.should.equal('tobi escaped'); - done(); - }); - - request(app.listen()) - .get('/') - .end(function(){}); - }) - }) - describe('when an error occurs', function(){ it('should emit "error" on the app', function(done){ var app = koa();