Syex
04/15/2020, 7:12 AMCoroutineScope
as an input in order to launch
some new coroutines. If any of these coroutines throw an exception it should delegate them to the initially given CoroutineScope
. However, I figured out, if this scope has a SupervisorJob()
all exceptions of my launched coroutines are just silently swallowed, which is probably working as intended.
Is there any way I still can crash the application? I tried to create my own scope via CoroutineScope(initialScope.coroutineContext + Job())
, but it still keeps the behavior of the supervisor job.tseisel
04/15/2020, 8:00 AMCoroutineExceptionHandler
in the context of the CoroutineScope
associated with the SupervisorJob
:
val exceptionHandler = CoroutineExceptionHandler { exception ->
// Do something with the caught error
}
val scope = CoroutineScope(SupervisorJob() + exceptionHandler)
Syex
04/15/2020, 9:01 AMCoroutineExceptionHandler
is never triggered this way 😕streetsofboston
04/15/2020, 11:20 AMSyex
04/15/2020, 11:51 AMCancellationException
which is ignored by CoroutineExceptionHandler
🙈rkeazor
04/15/2020, 1:26 PMSyex
04/15/2020, 1:29 PMrkeazor
04/15/2020, 1:32 PM