Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var job: Job? = null
fun startPresenting() {
job = loadData()
job?.invokeOnCompletion { it: Throwable? ->
it?.printStackTrace() // (1)
// or
job?.getCompletionException()?.printStackTrace() // (2)
// difference between (1) and (2) is that (1) will NOT contain CancellationException
// in case if job was cancelled
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment