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

elizarov

12/20/2017, 7:32 AM
I do believe that documentation for
getCancellationException
explains the purpose and behavior for this method quite well. Maybe we should rename it to reduce ambiguity and prevent its abuse? https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/get-cancellation-exception.html
l

Luis

12/20/2017, 7:41 AM
I had previously read that documentation and found it confusing to read so went the guess and check route. I've revisited it and still find it confusing. Specifically, "if it is an instance of CancellationException", does this mean if one called
job.cancel(CancellationException())
? It would also be clearer to separate the sentence: "Otherwise it returns an instance of JobCancellationException..." (at least that's how I'm reading it). Also, coming back to the original issue at hand, it doesn't mention anything about
cause
.
l

Luis

12/20/2017, 5:16 PM
yes that is much clearer!! thanks again
10 Views