Does the CoroutineExceptionHandler capture also a ...
# announcements
c
Does the CoroutineExceptionHandler capture also a CancellatioException in the case of launch? What I would like to do is to launch a bunch of coroutines under a SupervisorJob, and I want to, for robustness, relaunch the coroutine if it fails, but not if it's cancelled.
So I was thinking to use CoroutineExceptionHandler to be cleaner.
d
That should work. Cancellation exceptions are not handled by it, but their cause, if applicable, is.
c
Untitled.txt
so if i cancel or through a cancel exception manually the handler is not triggered
while other exceptions are caught, which is exactly what I need
so that i can relaunch the coroutine only when it really fails and I haven't caught the exception inside it, just trying to make it very robust and resilient
d
I think you should only relaunch if specific exceptions occur
c
u think so? why
l
#coroutines