remove socket error handling, use server "clientError"

This commit is contained in:
TJ Holowaychuk 2013-09-08 11:44:45 -07:00
parent cf54f7d7d5
commit 92b741ac0a
2 changed files with 0 additions and 27 deletions

View file

@ -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){

View file

@ -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();