https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

Dico

12/14/2018, 3:35 PM
So you're cancelling a coroutine that is waiting, and thus expecting no error to be logged when the exception is thrown
k

kevinherron

12/14/2018, 4:38 PM
i'm expecting
async
to capture the exception for propagation to an
await()
, as it does in most other cases
b

bdawg.io

12/14/2018, 5:04 PM
It doesn't propogate. The launch is what was cancelled. So when the launch resumed from suspension, its job saw it was cancelled (ignoring the state of the async) and throws the JobCancellationException. The async should resume because it's in the global supervisor scope
k

kevinherron

12/14/2018, 5:13 PM
sure, i expect the JobCancellationException
d

Dico

12/14/2018, 8:03 PM
I think
async
was indeed changed to also cancel the parent immediately upon failure, for consistency among coroutine builders.
So I'm guessing the supervisor is printing it to console when that occurs
3 Views