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 c657880 commit cb7eac1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
}
Expand Down

0 comments on commit cb7eac1

Please sign in to comment.