Created
October 9, 2017 04:58
-
-
Save dmytrodanylyk/4b78d3b8edd8d83e356129ee61eefeef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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