Is it possible to recover from multiple errors wit...
# arrow
d
Is it possible to recover from multiple errors with raise? For example having such function:
Copy code
context(_: Raise<StreamError>, _ : Raise<ServiceError.Expected>)
suspend fun getLiveStream(url: ChannelStreamUrl): Stream
a
you need to write several withError / recover, unless the errors are part of a common hierarchy
d
I will try that! Thank you
@Alejandro Serrano.Mena Should those recover be nested? Could you point me to an example?
a
yes, you should nest them. Any of the ways described in https://arrow-kt.io/learn/typed-errors/working-with-typed-errors/#recovering-from-typed-errors should work
d
Does the order matter?
y
Nope, although the order will allow you to transform one of them into the other if you wanted to
👍 1