Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinexception handling in coroutinesSingle-choice MCQ

In this code using `coroutineScope`, what is the observable behavior?

suspend fun work() = coroutineScope { launch { delay(50) throw IllegalStateException("boom") } launch { delay(500) println("second done") } } fun main() = runBlocking { try { work() } catch (e: IllegalStateException) { println("caught") } }