Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlincoroutine cancellation cooperationSingle-choice MCQ

Why does catching `CancellationException` in a generic `catch (e: Exception)` block inside a coroutine break structured concurrency, and what is the correct handling pattern?

launch { try { delay(1000) } catch (e: Exception) { // swallows CancellationException too log(e) } }