mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
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:
parent
3a97cfcc36
commit
f89b9305e8
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue