brabo-hi
01/25/2022, 12:12 AMcallbackFlow
?
fun connect():Flow<Item> = callbackFlow {
check(1 == 0) // This is expected to throw an IllegalStateException
}
louiscad
01/25/2022, 1:17 AMcollect { … }
or what's calling it under the hood, like first()
or something else.louiscad
01/25/2022, 1:18 AMcatch { … }
operator if it suits your use case.brabo-hi
01/25/2022, 1:38 AMconnect()
.catch{}
.first()
but still can’t catch the exceptionephemient
01/25/2022, 3:00 AM.first()
will fail if the flow is empty, as in your example. this is unrelated to the exception within your flow