```Hi What would be the cleanest way to handle er...
# rx
a
Copy code
Hi

What would be the cleanest way to handle error for parallel retrofit api calls using zip/combineLatest operator. How am I doing it right now. Using zip operator with let say 

val observable1 =client.fetchSomeData1().onErrorReturn{ t:Throwable ->SomeObject1(errorState)}
val observable2 =client.fetchSomeData2().onErrorReturn{ t:Throwable ->SomeObject2(errorState)} //errorstate filterout for sake of brewety


Observable.zip(observable1,observable2){Pair(SomeObject1,SomeObject2)}.subscribe{t:Pair<SomeObject1,SomeObject2>-> 

t.first?.let{
	
	//handle based on the requirment
}}

t.second?.let{
//handle based on the requirment	
}


Is this the right way to handle error in zip if we have to perform simultaneous request to server and handle error for respective request. Or is there any better way to solve this

Help appreciated