From f89b9305e89a1d96d00c9b61bd34022e04ea0be9 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 9 Jun 2022 15:33:46 +0100 Subject: [PATCH] handling the unavailable homeserver error case in the error formatting as this is now possible via full matrix id handling# --- .../app/features/onboarding/ftueauth/LoginErrorParser.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/LoginErrorParser.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/LoginErrorParser.kt index 271c1ced14..ac79419312 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/LoginErrorParser.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/LoginErrorParser.kt @@ -20,6 +20,7 @@ import im.vector.app.R import im.vector.app.core.error.ErrorFormatter import im.vector.app.core.resources.StringProvider import im.vector.app.features.onboarding.ftueauth.LoginErrorParser.LoginErrorResult +import org.matrix.android.sdk.api.failure.isHomeserverUnavailable import org.matrix.android.sdk.api.failure.isInvalidPassword import org.matrix.android.sdk.api.failure.isInvalidUsername import org.matrix.android.sdk.api.failure.isLoginEmailUnknown @@ -40,6 +41,9 @@ class LoginErrorParser @Inject constructor( throwable.isInvalidPassword() && password.hasSurroundingSpaces() -> { LoginErrorResult(throwable, passwordError = stringProvider.getString(R.string.auth_invalid_login_param_space_in_password)) } + throwable.isHomeserverUnavailable() -> { + LoginErrorResult(throwable, usernameOrIdError = stringProvider.getString(R.string.login_error_homeserver_not_found)) + } else -> { LoginErrorResult(throwable) }