Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 17:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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