These are chat archives for ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
if onComplete blows up (which is illegal) there is no good way to handle that ... it is undefined behavior. We typically just throw a bad runtime exception. You can possibly try and catch the error and send it via onError, but that's also undefined behavior as the Observer/Subscriber has now received 2 terminal events.
In other words ... onError or onCompleted throwing an exception is illegal and puts everything into an undefined state, and RxJava tries it's best to clean up and expose the thrown Runtime exception.
If onNext fails (also illegal) it can generally be recovered by catching and passing it to onError.
onNextfails would be a good way to deal with that but I was clueless about exceptions in
Observer.onCompleted should not ever throw. That breaks the contract and puts the system into undefined state. So, it's best to avoid user code that can throw from inside onCompleted.
So what are you doing inside onCompleted? For example, are you using the onCompleted signal to invoke user code?