handling the unavailable homeserver error case in the error formatting as this is now possible via full matrix id handling#

This commit is contained in:
Adam Brown 2022-06-09 15:33:46 +01:00
parent 3a97cfcc36
commit f89b9305e8

View file

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