mirror of
https://github.com/element-hq/element-android
synced 2024-10-07 08:41:25 +00:00
Use "when" subject.
This commit is contained in:
parent
36bd2290e9
commit
fa0adb17b8
|
@ -40,10 +40,10 @@ class DefaultErrorFormatter @Inject constructor(
|
|||
null -> null
|
||||
is IdentityServiceError -> identityServerError(throwable)
|
||||
is Failure.NetworkConnection -> {
|
||||
when {
|
||||
throwable.ioException is SocketTimeoutException ->
|
||||
when (throwable.ioException) {
|
||||
is SocketTimeoutException ->
|
||||
stringProvider.getString(R.string.error_network_timeout)
|
||||
throwable.ioException is UnknownHostException ->
|
||||
is UnknownHostException ->
|
||||
// Invalid homeserver?
|
||||
// TODO Check network state, airplane mode, etc.
|
||||
stringProvider.getString(R.string.login_error_unknown_host)
|
||||
|
|
Loading…
Reference in a new issue