Hi, is there a reason why I am seeing multiple `Ca...
# coroutines
m
Hi, is there a reason why I am seeing multiple
CancellationException
s related to coroutines? First, there is
kotlin.coroutines.cancellation.CancellationException
, which is part of
kotlin-stdlib:1.6.21
and there is also
kotlinx.coroutines.CancellationException
which comes from
kotlinx-coroutines-core-jvm:1.6.1
. I can see that they are both just typealiases for
java.util.concurrent.CancellationException
so in the end it doesn’t matter, but it tends to cause mess in the code.
3
r
Can’t tell you for sure, but it looks like backwards compatibility. The
CancellationException
from kotlinx-coroutines has been present for a long time (before Kotlin 1.4). The
CancellationException
in stdlib has only been there since Kotlin 1.4. In the current versions of kotlinx-coroutines the
CancellationException
is actually a typealias for the one in stdlib. So effectively there is no difference between the two.