Don Mitchell
10/18/2024, 1:55 PMsupervisorScope
. Is it swallowing CancellationException, VirtualMachineError, ThreadDeath, LinkageError, InterruptedException
and other "fatal" errors? If so, how to ensure it doesn't. I may have confused myself wrt CoroutineExceptionHandler
Can it rethrow the exception? My reading of it is that it's just a non-control hook.Dmitry Khalanskiy [JB]
10/18/2024, 2:02 PMCoroutineExceptionHandler
handles the exceptions it's provided. With it, you can avoid exceptions crashing your application. If you want your application (on Android) to crash, simply don't use any CoroutineExceptionHandler
.Don Mitchell
10/18/2024, 2:03 PMDmitry Khalanskiy [JB]
10/18/2024, 2:05 PMDon Mitchell
10/18/2024, 2:07 PMYou cannot recover from the exception in thebut gives no hint as to how to terminate or restart. I guess I overinterpreted "cannot recover" as saying it was outside the control flow.. The coroutine had already completed with the corresponding exception when the handler is called. Normally, the handler is used to log the exception, show some kind of error message, terminate, and/or restart the application.CoroutineExceptionHandler
Dmitry Khalanskiy [JB]
10/18/2024, 2:10 PMCoroutineExceptionHandler
can make it continue executing, it will stop in any case.