https://kotlinlang.org logo
Title
d

darkmoon_uk

11/09/2021, 2:02 AM
I noticed during testing that within a
callbackFlow { ... }
if we throw a plain
Exception
this halts the VM immediately, and is not caught as an in-
Flow
`.catch`able error, while throwing a
RuntimeException
is `.catch`able. While this isn't so surprising given the conventional relationship between
Exception
and
RuntimeException
, I can't find this documented in respect to Flows - should it be? Is it?
e

ephemient

11/09/2021, 2:17 AM
on playground, the ordering of send vs catch seems non-deterministic but catch always seems to work: https://pl.kotl.in/kihB7LrBS
d

darkmoon_uk

11/09/2021, 2:46 AM
Thanks @ephemient, nice use of playground too 👍
The difference must in our code, this helps.