From accb1d6a611d18773e84f8b6e076dad546f3f91f Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Fri, 8 Nov 2013 01:17:41 -0800 Subject: [PATCH] pass an optional `next` to app.callback() --- lib/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/application.js b/lib/application.js index bf28587..d511ff5 100644 --- a/lib/application.js +++ b/lib/application.js @@ -88,10 +88,10 @@ app.callback = function(){ var gen = compose(mw); var self = this; - return function(req, res){ + return function(req, res, next){ var ctx = new Context(self, req, res); - co.call(ctx, gen)(ctx.onerror); + co.call(ctx, gen)(next || ctx.onerror); } };