Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GauravChaddha1996/1f7aa4033169e03cf96b1c79246d0f44 to your computer and use it in GitHub Desktop.
Save GauravChaddha1996/1f7aa4033169e03cf96b1c79246d0f44 to your computer and use it in GitHub Desktop.
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