From f90d547e0fefb835c409f6bbc1da22917819e3b5 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Mon, 25 Jun 2018 13:46:56 -0700 Subject: [PATCH] fix(middleware): Obey the Promise API. Rather than catching and discarding the error if no error handler is passed, let the promise package chain it. This allows use to have a .catch() follow the then(). --- lib/middleware/common.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/middleware/common.js b/lib/middleware/common.js index d338f2b06..2a001dd35 100644 --- a/lib/middleware/common.js +++ b/lib/middleware/common.js @@ -16,8 +16,7 @@ class PromiseContainer { } then (success, error) { - error = error || _.noop - return this.promise.then(success).catch(error) + return this.promise.then(success, error) } set (newPromise) {