<lambda>null1// This file was automatically generated from flow.md by Knit tool. Do not edit. 2 package kotlinx.coroutines.guide.exampleFlow33 3 4 import kotlinx.coroutines.* 5 import kotlinx.coroutines.flow.* 6 7 fun simple(): Flow<Int> = flow { 8 emit(1) 9 throw RuntimeException() 10 } 11 <lambda>null12fun main() = runBlocking<Unit> { 13 simple() 14 .onCompletion { cause -> if (cause != null) println("Flow completed exceptionally") } 15 .catch { cause -> println("Caught exception") } 16 .collect { value -> println(value) } 17 } 18