Change return type (mostly for clarity)

This commit is contained in:
Benoit Marty
2023-07-17 22:03:21 +02:00
parent 98131d3046
commit ddf432bb72
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ package io.element.android.libraries.matrix.impl.auth
import io.element.android.libraries.matrix.api.auth.AuthenticationException
import org.matrix.rustcomponents.sdk.AuthenticationException as RustAuthenticationException
fun Throwable.mapAuthenticationException(): Throwable {
fun Throwable.mapAuthenticationException(): AuthenticationException {
return when (this) {
is RustAuthenticationException.ClientMissing -> AuthenticationException.ClientMissing(this.message!!)
is RustAuthenticationException.Generic -> AuthenticationException.Generic(this.message!!)

View File

@@ -19,7 +19,7 @@ package io.element.android.libraries.matrix.impl.exception
import io.element.android.libraries.matrix.api.exception.ClientException
import org.matrix.rustcomponents.sdk.ClientException as RustClientException
fun Throwable.mapClientException(): Throwable {
fun Throwable.mapClientException(): ClientException {
return when (this) {
is RustClientException.Generic -> ClientException.Generic(msg)
else -> ClientException.Other(message ?: "Unknown error")