Fix codeAnalysis errors
This commit is contained in:
parent
516b097e9e
commit
1aa0b48b0a
8 changed files with 37 additions and 13 deletions
|
|
@ -14,11 +14,15 @@ internal class SessionAuthenticator(
|
|||
private val networkSessionExpirationListener: NetworkSessionExpirationListener
|
||||
) : Authenticator {
|
||||
|
||||
@Suppress("SwallowedException")
|
||||
override fun authenticate(route: Route?, response: Response): Request? {
|
||||
if (authenticationHeaderUtils.hasToken(response.request)) {
|
||||
return runBlocking {
|
||||
try {
|
||||
val newSession = loginRemoteSource.refresh(networkSessionLocalStorage.session?.refreshToken.orEmpty())
|
||||
val refreshToken = networkSessionLocalStorage.session
|
||||
?.refreshToken
|
||||
.orEmpty()
|
||||
val newSession = loginRemoteSource.refresh(refreshToken)
|
||||
networkSessionLocalStorage.session = newSession
|
||||
return@runBlocking authenticationHeaderUtils.attachToken(response.request)
|
||||
} catch (throwable: Throwable) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.io.EOFException
|
|||
|
||||
internal object ExceptionWrapper {
|
||||
|
||||
@Suppress("RethrowCaughtException")
|
||||
@Throws(NetworkException::class, ParsingException::class)
|
||||
suspend fun <T> wrap(request: suspend () -> T) = try {
|
||||
request()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue