mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-02 20:26:47 +01:00
Use "when" subject.
This commit is contained in:
parent
36bd2290e9
commit
fa0adb17b8
@ -40,14 +40,14 @@ class DefaultErrorFormatter @Inject constructor(
|
|||||||
null -> null
|
null -> null
|
||||||
is IdentityServiceError -> identityServerError(throwable)
|
is IdentityServiceError -> identityServerError(throwable)
|
||||||
is Failure.NetworkConnection -> {
|
is Failure.NetworkConnection -> {
|
||||||
when {
|
when (throwable.ioException) {
|
||||||
throwable.ioException is SocketTimeoutException ->
|
is SocketTimeoutException ->
|
||||||
stringProvider.getString(R.string.error_network_timeout)
|
stringProvider.getString(R.string.error_network_timeout)
|
||||||
throwable.ioException is UnknownHostException ->
|
is UnknownHostException ->
|
||||||
// Invalid homeserver?
|
// Invalid homeserver?
|
||||||
// TODO Check network state, airplane mode, etc.
|
// TODO Check network state, airplane mode, etc.
|
||||||
stringProvider.getString(R.string.login_error_unknown_host)
|
stringProvider.getString(R.string.login_error_unknown_host)
|
||||||
else ->
|
else ->
|
||||||
stringProvider.getString(R.string.error_no_network)
|
stringProvider.getString(R.string.error_no_network)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user