doesn’t crash the app? Given there is no supervisor job I was expecting this to crash the program but it doesn’t.
I can see the ‘Starting’ the crash and then ‘job done’ in the logs 🤔
builder creates a scope and then waits for all of its children to complete. That’s what causes it to throw an exception to the containing function if one of its child jobs fails.
s
streetsofboston
11/07/2022, 12:31 PM
What @Sam said is what you should do to maintain the same lifecycle as the calling CoroutineScope, but Alex's example is also valid; switching lifecycle by executing/launching something in a brand new CoroutineScope.
The new CoroutineScope doesn't have a CoroutineExceptionHandler installed and therefore I'd expect the JVM's Thread Uncaught Exception Handler to take care of it by default (which would crash the app/main)....