From c9319c7c3880abae669ffd6e657d2ea9a09891db Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 23 Aug 2021 16:58:54 +0530 Subject: [PATCH] Catch any error from queryLogin Signed-off-by: RMidhunSuresh --- src/domain/login/CompleteSSOLoginViewModel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/domain/login/CompleteSSOLoginViewModel.js b/src/domain/login/CompleteSSOLoginViewModel.js index c06b3ffd..c1f6223c 100644 --- a/src/domain/login/CompleteSSOLoginViewModel.js +++ b/src/domain/login/CompleteSSOLoginViewModel.js @@ -44,7 +44,14 @@ export class CompleteSSOLoginViewModel extends ViewModel { return; } const homeserver = await this.platform.settingsStorage.getString("sso_ongoing_login_homeserver"); - const loginOptions = await this._sessionContainer.queryLogin(homeserver); + let loginOptions; + try { + loginOptions = await this._sessionContainer.queryLogin(homeserver); + } + catch (err) { + this._showError(err.message); + return; + } if (!loginOptions.token) { const path = this.navigation.pathFrom([this.navigation.segment("session")]); this.navigation.applyPath(path);