diff --git a/lib/application.js b/lib/application.js index 9036c82..00a63d8 100644 --- a/lib/application.js +++ b/lib/application.js @@ -97,11 +97,10 @@ app.callback = function(){ var fn = co(gen); var self = this; - return function(req, res, next){ + return function(req, res){ var ctx = self.createContext(req, res); - next = next || ctx.onerror; - ctx.onSocketError(next); - fn.call(ctx, next); + ctx.onSocketError(ctx.onerror); + fn.call(ctx, ctx.onerror); } };