hey guys, I’d like some help figuring out how to better handle errors emitted from this observable.
I want to parse multiple files eagerly, then wait for all of them to complete, and know which files failed. Is this possible?
This is what I have so far:
sealed class Result(){
class Content(val content: Type) : Result
class Error(val error: Throwable): Result
}
rook
07/15/2019, 10:21 PM
Then you have a list of
Result
and you can decide what to do based on the type of
Result
it is
👍 1
u
ursus
07/16/2019, 10:49 AM
If you want to wait for all to complete/error, not the first one, then you dont want rx error at all, since that is like a exception, it exits your normal flow. So, yes what above is said, map it into some error constant / wrap into Result type. Then use Single.zip for example