Skip to content

Instantly share code, notes, and snippets.

@vvsevolodovich
Created April 17, 2018 15:01
Show Gist options
  • Save vvsevolodovich/98f592357e0fc39a2d4d88222ee2bf00 to your computer and use it in GitHub Desktop.
Save vvsevolodovich/98f592357e0fc39a2d4d88222ee2bf00 to your computer and use it in GitHub Desktop.
SingleSubscribe
@SchedulerSupport(SchedulerSupport.NONE)
@Override
public final void subscribe(SingleObserver<? super T> subscriber) {
ObjectHelper.requireNonNull(subscriber, "subscriber is null");
subscriber = RxJavaPlugins.onSubscribe(this, subscriber);
ObjectHelper.requireNonNull(subscriber, "subscriber returned by the RxJavaPlugins hook is null");
try {
subscribeActual(subscriber);
} catch (NullPointerException ex) {
throw ex;
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
NullPointerException npe = new NullPointerException("subscribeActual failed");
npe.initCause(ex);
throw npe;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment