Join Slack
Exceptions that happen inside a callback used inside a `callbackFlow` can not be caught with the `ca...
# coroutines
f
Florian
12/06/2020, 8:35 PM
Exceptions that happen inside a callback used inside a
callbackFlow
can not be caught with the
catch
operator?
a
Adam Powell
12/06/2020, 8:40 PM
They can if the
callbackFlow
catches them and `close()`s the channel with the exception
Adam Powell
12/06/2020, 8:41 PM
But since no part of the flow machinery is involved in dispatching the callback, it can't do it automatically
f
Florian
12/06/2020, 8:48 PM
Is this the right way to do it?
Florian
12/06/2020, 9:00 PM
I'm trying that but these errors don't end up in my catch operator
Florian
12/06/2020, 9:37 PM
nevermind, I think I have it figured out now
Florian
12/06/2020, 9:37 PM
it's pretty late and my brain is mush now
6
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by