From eccea7411f9793464ace8636c2a8a1cd39a90bc4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 21 Aug 2017 16:31:42 +0100 Subject: [PATCH] Fix error handling in interactive-auth Now that we are using bluebird, `defer.reject` is not implicitly bound, so we need to call it properly rather than just passing it into the catch handler. This fixes an error: promise.js:711 Uncaught TypeError: Cannot read property 'promise' of undefined --- src/interactive-auth.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interactive-auth.js b/src/interactive-auth.js index ea7675a57..0945c31e3 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -293,7 +293,9 @@ InteractiveAuth.prototype = { }, ); if (!background) { - prom = prom.catch(this._completionDeferred.reject); + prom = prom.catch((e) => { + this._completionDeferred.reject(e); + }); } else { // We ignore all failures here (even non-UI auth related ones) // since we don't want to suddenly fail if the internet connection