From 274758f61593337f359ea99ff6dca25269919f6a Mon Sep 17 00:00:00 2001 From: David Banham Date: Tue, 4 Apr 2017 15:29:30 +1000 Subject: [PATCH] Properly bubble errors up the stack --- lib/application.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/application.js b/lib/application.js index 3220856d..a0b886cf 100644 --- a/lib/application.js +++ b/lib/application.js @@ -156,7 +156,8 @@ Object.assign(Application.prototype, { }) .catch(function(err) { logger.error(err); - throw err; + reject(err); + callback && callback(err); }) }); @@ -220,7 +221,8 @@ Object.assign(Application.prototype, { }) .catch(function(err) { logger.error(err); - throw err; + reject(err); + callback && callback(err); }) }, { stream: options.stream }); }) @@ -347,7 +349,8 @@ Object.assign(Application.prototype, { }) .catch(function(err) { logger.error(err); - throw err; + reject(err); + callback && callback(err); }) }, { stream: options.stream });