Its unclear how to propagate errors to subscribers in REactiveX such that the Observable doesn't get destroyed.
Example
observable.onNext(1);
observable.onNext(2);
observable.onError("Nope");
observable.onNext(3);<<won't work.
I accept this restriction as it is, however I still have scenario where I want listeners downstream to know an error occured AND I don't want the observable to die.
The main use case for this is UI code that, if an error comes through, I don't want to have to call "Setup" against all the observables it previously registered with.
Possible alternatives are
a) push a custom object that has a data field and an error field
class Data
{
int value;
Error * error;
}
I don't like this solution
b) Have two streams. One for data and one for errors.
observable.onNext(1);
observable.onNext(2);
errorObservable.onNext("Error");
observable.onNext(3);
What are the best common practices for this?