From cb7eac1418eee83c57e08a264c8d3dbd92b1056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jc=20Mi=C3=B1arro?= Date: Thu, 6 Jul 2023 12:55:01 +0200 Subject: [PATCH] Fix Detekt --- .../getstream/chat/android/client/user/CurrentUserFetcher.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/user/CurrentUserFetcher.kt b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/user/CurrentUserFetcher.kt index 1c1251bc32a..af1c1b796ac 100644 --- a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/user/CurrentUserFetcher.kt +++ b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/user/CurrentUserFetcher.kt @@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.mapNotNull import kotlinx.coroutines.withTimeoutOrNull +import java.io.UnsupportedEncodingException /** * Fetches the current user from the backend. @@ -58,13 +59,13 @@ internal class CurrentUserFetcher( ws.listen().firstUserWithTimeout(TIMEOUT_MS).also { logger.v { "[fetch] completed: $it" } } - } catch (e: Throwable) { + } catch (e: UnsupportedEncodingException) { logger.e { "[fetch] failed: $e" } Result.Failure(Error.ThrowableError(e.message.orEmpty(), e)) } finally { try { ws?.close() - } catch (_: Exception) { + } catch (_: IllegalArgumentException) { // no-op } }