enighma
04/13/2022, 8:27 AMSam
04/13/2022, 8:34 AMtry {
...
} finally {
withContext(NonCancellable) {
// can suspend even after cancellation
}
}
enighma
04/13/2022, 8:38 AMscope.launch(exceptionHandler) {
}
However, once an exception happens, the scope cannot be used again.
One solution is to add a try-catch inside of the launch{}
but I might just not understand how
CoroutineExceptionHandler
is intended to workSam
04/13/2022, 8:40 AMCoroutineExceptionHandler
happens after the coroutine has completed. It doesn't let you recover from the exception. https://kotlinlang.org/docs/exception-handling.html#coroutineexceptionhandlerenighma
04/13/2022, 8:41 AMildar.i [Android]
04/14/2022, 9:53 AM