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;