public static void onError(Subscriber<?> subscriber, Throwable ex,
            AtomicInteger wip, AtomicThrowable error) {
        if (error.addThrowable(ex)) {
            if (wip.getAndIncrement() == 0) {
                subscriber.onError(error.terminate());
            }
        } else {
            RxJavaPlugins.onError(ex);
        }
    }
public static void onError(Subscriber<?> subscriber, Throwable ex,
            AtomicInteger wip, AtomicThrowable error) {
        if (error.addThrowable(ex)) {
            if (wip.getAndIncrement() == 0) {
                subscriber.onError(error.terminate());
            }
        } else {
            RxJavaPlugins.onError(ex);
        }
    }
public static void onError ( Subscriber < ? > subscriber , Throwable ex , AtomicInteger wip , AtomicThrowable error ) { if ( error . addThrowable ( ex ) ) { if ( wip . getAndIncrement ( ) == 0 ) { subscriber . onError ( error . terminate ( ) ) ; } } else { RxJavaPlugins . onError ( ex ) ; } }
Emits the given exception if possible or adds it to the given error container to
be emitted by a concurrent onNext if one is running.
Undeliverable exceptions are sent to the RxJavaPlugins.onError.
@param subscriber the target Subscriber to emit to
@param ex the Throwable to emit
@param wip the serialization work-in-progress counter/indicator
@param error the holder of Throwables
Emits the given exception if possible or adds it to the given error container to be emitted by a concurrent onNext if one is running . Undeliverable exceptions are sent to the RxJavaPlugins . onError .