From 70b9e433af3cd61df573244cf4972ec0f1f95597 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 11 Dec 2024 09:57:45 +0100 Subject: [PATCH] Handle new EventCache Exception --- .../libraries/matrix/impl/auth/AuthenticationException.kt | 1 + .../matrix/impl/auth/AuthenticationExceptionMappingTest.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationException.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationException.kt index cf48d68c70..c3a920dc69 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationException.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationException.kt @@ -22,6 +22,7 @@ fun Throwable.mapAuthenticationException(): AuthenticationException { is ClientBuildException.SlidingSync -> AuthenticationException.Generic(message) is ClientBuildException.WellKnownDeserializationException -> AuthenticationException.Generic(message) is ClientBuildException.WellKnownLookupFailed -> AuthenticationException.Generic(message) + is ClientBuildException.EventCache -> AuthenticationException.Generic(message) } else -> AuthenticationException.Generic(message) } diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationExceptionMappingTest.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationExceptionMappingTest.kt index 81a1667f4e..810adbfb3a 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationExceptionMappingTest.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/auth/AuthenticationExceptionMappingTest.kt @@ -52,6 +52,8 @@ class AuthenticationExceptionMappingTest { .isException("WellKnown Deserialization") assertThat(ClientBuildException.WellKnownLookupFailed("WellKnown Lookup Failed").mapAuthenticationException()) .isException("WellKnown Lookup Failed") + assertThat(ClientBuildException.EventCache("EventCache error").mapAuthenticationException()) + .isException("EventCache error") } private inline fun ThrowableSubject.isException(message: String) {