Skip to content

Commit 30ab454

Browse files
committed
Do not warn on CancellationException
1 parent 0940025 commit 30ab454

File tree

1 file changed

+3
-0
lines changed
  • shared/src/commonMain/kotlin/org/datepollsystems/waiterrobot/shared/core/viewmodel

1 file changed

+3
-0
lines changed

shared/src/commonMain/kotlin/org/datepollsystems/waiterrobot/shared/core/viewmodel/AbstractViewModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.datepollsystems.waiterrobot.shared.core.viewmodel
22

33
import dev.icerock.moko.mvvm.viewmodel.ViewModel
4+
import kotlinx.coroutines.CancellationException
45
import kotlinx.coroutines.CoroutineExceptionHandler
56
import kotlinx.coroutines.flow.MutableSharedFlow
67
import kotlinx.coroutines.launch
@@ -44,6 +45,8 @@ abstract class AbstractViewModel<S : ViewModelState, E : ViewModelEffect>(
4445
buildSettings = {
4546
exceptionHandler = CoroutineExceptionHandler { _, exception ->
4647
when (exception) {
48+
is CancellationException -> Unit // Expected, nothing to do here
49+
4750
is ApiException.AppVersionTooOld -> intent {
4851
navigator.replaceRoot(Screen.UpdateApp)
4952
}

0 commit comments

Comments
 (0)