Skip to content

Commit

Permalink
Fix Detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
JcMinarro committed Jul 6, 2023
1 parent 502b6f5 commit ae80559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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.
Expand All @@ -60,13 +61,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.error(ChatError(e.message, e))
} finally {
try {
ws?.close()
} catch (_: Exception) {
} catch (_: IllegalArgumentException) {
// no-op
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package io.getstream.chat.android.client.user

import io.getstream.chat.android.client.Mother.randomConnectedEvent
import io.getstream.chat.android.client.errors.ChatError
import io.getstream.chat.android.client.Mother.randomUser
import io.getstream.chat.android.client.api.ChatClientConfig
import io.getstream.chat.android.client.errors.ChatError
import io.getstream.chat.android.client.errors.ChatErrorCode
import io.getstream.chat.android.client.errors.ChatNetworkError
import io.getstream.chat.android.client.events.ChatEvent
Expand All @@ -29,10 +29,10 @@ import io.getstream.chat.android.client.scope.UserScope
import io.getstream.chat.android.client.scope.UserTestScope
import io.getstream.chat.android.client.socket.ErrorResponse
import io.getstream.chat.android.client.socket.SocketErrorMessage
import io.getstream.chat.android.client.utils.Result
import io.getstream.chat.android.test.TestCoroutineExtension
import io.getstream.chat.android.client.socket.SocketFactory
import io.getstream.chat.android.client.socket.experimental.ws.StreamWebSocket
import io.getstream.chat.android.client.utils.Result
import io.getstream.chat.android.test.TestCoroutineExtension
import io.getstream.chat.android.test.randomBoolean
import io.getstream.chat.android.test.randomString
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down

0 comments on commit ae80559

Please sign in to comment.