1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

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
This commit is contained in:
Richard van der Hoff
2017-08-21 16:31:42 +01:00
parent 2d82a7bc2e
commit eccea7411f

View File

@@ -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