src/main/java/io/reactivex/Single.java
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doOnError(final Consumer<? super Throwable> onError) {
        ObjectHelper.requireNonNull(onError, "onError is null");
        return RxJavaPlugins.onAssembly(new SingleDoOnError<T>(this, onError));
    }
@CheckReturnValue
    @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public final Single<T> doOnError(final Consumer<? super Throwable> onError) {
        ObjectHelper.requireNonNull(onError, "onError is null");
        return RxJavaPlugins.onAssembly(new SingleDoOnError<T>(this, onError));
    }
Calls the shared consumer with the error sent via onError for each
SingleObserver that subscribes to the current Single.
<p>
<img width="640" height="349" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.doOnError.2.png" alt="">
</p>
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code doOnError} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param onError the consumer called with the success value of onError
@return the new Single instance
@since 2.0