Don Mitchell
11/22/2024, 3:39 PMsupervisorScope
is catching, reporting, and ignoring. I don't see any means to tell supervisorScope
to not catch fatal errors. Am I missing something? Is there a better pattern? (I guess I could just use `try..catch`to keep non-fatal errors from cancelling the parent?) Fatal errors = OOM, VirtualMachineError, ThreadDeath, LinkageError, InterruptedException, CancellationException.Don Mitchell
11/22/2024, 3:47 PMsupervisorScope
and I think it's too robust for our use 😞 . From what I can tell, it's design is to catch all errors even fatal ones allowing the throwing coroutine to die but none of its siblings nor future ones. I may add a side effect to the CoroutineExceptionHandler to set a semaphore if fatal error and use that to abandon the top level iteration unless anyone has a better idea.Youssef Shoaib [MOD]
11/22/2024, 7:08 PMSupervisorJob
using Arrow's nonFatalOrThrow
Jeremiah Van Offeren
11/22/2024, 8:14 PMCoroutineContext.Element
so can be added to other context elements and will allow for custom exception handling
https://kotlinlang.org/docs/exception-handling.html