From e6539e1cf28e5cb5418d9dd3c364c03198610cf1 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Wed, 8 Mar 2017 00:05:28 -0700 Subject: [PATCH] Return middleware chain promise from `callback()` (#848) The v2.x version of 8836cd3 on master. --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 4c4dab4..d68a995 100644 --- a/lib/application.js +++ b/lib/application.js @@ -134,7 +134,7 @@ module.exports = class Application extends Emitter { const onerror = err => ctx.onerror(err); const handleResponse = () => respond(ctx); onFinished(res, onerror); - fn(ctx).then(handleResponse).catch(onerror); + return fn(ctx).then(handleResponse).catch(onerror); }; return handleRequest;