Would it make more sense for `CancellationExceptio...
# coroutines
j
Would it make more sense for
CancellationException
to not be an
Exception
? It really doesn't fall under that category. It doesn't represent some kind of issue; it represents that we don't care about the result anymore. It seems like it should inherit from
Throwable
and be treated entirely differently.
y
Issue is that it maps to Java's equivalent, so we're kinda constrained on what it can be
j
the jvm hurts my soul once again
🫠 3
y
A lot of things are exceptions though, including some very fatal ones that should not be caught
c
@Youssef Shoaib [MOD] To be pedantic, they are not exceptions, they are throwables, which can represent non-exceptional weird things
y
InterruptedException
is though, and it's very analogous to
CancellationException
c
IMO, based on the initial definitions of Throwable/Exception, InterruptedException shouldn't be an Exception either
Looks like it's an exception because the Java authors wanted it to be checked https://stackoverflow.com/a/28571470
so it's two levels of "it's like that because of old stuff"
y
That's very fair yeah. Issue is though that we really want to support Java's cancellation exception in the same way. It's also never good practice to catch
Exception
anyway