Prevent OnErrorNotImplementedException

If you are using Kotlin then the syntax is like

 .subscribe({success -> doOnSuccess(success)},{error -> doOnError(error)})

Here is another possible solution, you can define the onNext and a Throwable (also you cannot loose the lambda syntax):

.subscribe(t -> doSomething(t), e -> showError(e));

here's how we do it at work. Instead of making actions we made an abstract NYTSubscriber which has onError and onCompleted implemented. This way you can use this subscriber and only implement the onNext callback OR you can override onError and onCompleted when necessary

public abstract class NYTSubscriber<T> extends Subscriber<T> {

@Override
public void onCompleted() {
}

@Override
public void onError(Throwable e) {
}
}