Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
runBlocking {
val ceh = CoroutineExceptionHandler { _, throwable ->
println("Failure with ${throwable.localizedMessage}")
}
supervisorScope {
launch(ceh) {
throw Exception("Exception1")
}
launch {
delay(100)
println("C2 still executing")
}
}
println("After supervisor scope")
}
Output:
Failure with Exception1
C2 still executing
After supervisor scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment