This file contains 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
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