Exclude instruction from try catch block

This commit is contained in:
Benoit Marty 2021-04-07 14:34:06 +02:00
parent b8d01c4577
commit 1ac17b3aee
1 changed files with 9 additions and 12 deletions

View File

@ -161,25 +161,22 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
lifecycleScope.launch {
try {
session.signOut(!args.isUserLoggedOut)
} catch (failure: Throwable) {
displayError(failure)
return@launch
}
Timber.w("SIGN_OUT: success, start app")
sessionHolder.clearActiveSession()
doLocalCleanup(clearPreferences = true)
startNextActivityAndFinish()
} catch (failure: Throwable) {
displayError(failure)
}
}
}
args.clearCache -> {
lifecycleScope.launch {
try {
session.clearCache()
doLocalCleanup(clearPreferences = false)
session.startSyncing(applicationContext)
startNextActivityAndFinish()
} catch (failure: Throwable) {
displayError(failure)
}
}
}
}