Skip to content

Instantly share code, notes, and snippets.

@shah-vraj
Last active June 26, 2025 19:46
Show Gist options
  • Save shah-vraj/9d31d6845c38da8d5d5df8f4706e84e8 to your computer and use it in GitHub Desktop.
Save shah-vraj/9d31d6845c38da8d5d5df8f4706e84e8 to your computer and use it in GitHub Desktop.
Using try catch to handle exception in coroutine scope
coroutineScope {
try {
launch {
throw RuntimeException("This won't be caught here")
}
} catch (e: Exception) {
println("Caught: ${e.message}") // This won't be triggered
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment