@Override public void call(Subscriber<? super T> subscriber) { subscriber.onError(error); } });
@Override public void onError(Throwable e) { boolean _onNextArrived; synchronized (this) { _onNextArrived = onNextArrived; } terminated = true; error = e; if (_onNextArrived) { delegate.onError(e); } }
@Override public void onError(Throwable e) { subscriber.onError(e); }
@Override public void onError(Throwable e) { subscriber.onError(e); }
@Override public void onError(Throwable throwable) { if (!subscriberTerminated) { subscriber.onError(throwable); } else { // This should never happen! onNext handles and forwards errors automatically. Throwable broken = new AssertionError( "This should never happen! Report as a Retrofit bug with the full stacktrace."); //noinspection UnnecessaryInitCause Two-arg AssertionError constructor is 1.7+ only. broken.initCause(throwable); RxJavaPlugins.getInstance().getErrorHandler().handleError(broken); } }
@Override public void onError(Throwable throwable) { if (!subscriberTerminated) { subscriber.onError(throwable); } else { Throwable broken = new AssertionError("This should never happen! Report as a bug with the full stacktrace."); //noinspection UnnecessaryInitCause Two-arg AssertionError constructor is 1.7+ only. broken.initCause(throwable); RxJavaHooks.getOnError().call(broken); } }
@Override public void onError(Throwable e) { if (isNotTimedOut()) { // stop timer and pass notification through tl.clear(); child.onError(e); } }
/** * Produces an observable that throws a {@link DocumentDoesNotExistException}. * * @param entityClass Entity class. * @param id Entity id. * @param <T> Entity type. * @return An observable that throws a {@link DocumentDoesNotExistException}. */ @SuppressWarnings("rawtypes") static <T> Observable<T> notFound(final Class entityClass, final Object id) { return Observable.create(s -> s.onError(new DocumentDoesNotExistException(N1Q.qualifyId(entityClass, id)))); }
private void newConnectionSubscriber(ChannelSubscriberEvent<R, W> event) { if (null == newChannelSub) { newChannelSub = event.getSubscriber(); } else { event.getSubscriber().onError(ONLY_ONE_CONN_SUB_ALLOWED); } }
public void sendOnNext(T nextItem) { if (requested > 0) { if (REQUEST_UPDATER.get(this) != Long.MAX_VALUE) { REQUEST_UPDATER.decrementAndGet(this); } subscriber.onNext(nextItem); } else { subscriber.onError(new MissingBackpressureException( "Received more data on the channel than demanded by the subscriber.")); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (!connectionEmitted && isValidToEmit(newChannelSub)) { newChannelSub.onError(cause); } else if (isValidToEmitToReadSubscriber(readProducer)) { readProducer.sendOnError(cause); } else { logger.info("Exception in the pipeline and none of the subscribers are active.", cause); } }
@Override public void call(Subscriber<? super Boolean> sub) { latch.countDown(); try { latch.await(); sub.onNext(true); sub.onCompleted(); } catch (InterruptedException e) { sub.onError(e); } } }).subscribeOn(Schedulers.computation()).toBlocking().toFuture());
@Override public void onNext(Response<R> response) { if (response.isSuccessful()) { subscriber.onNext(response.body()); } else { subscriberTerminated = true; Throwable t = new HttpException(response); try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } }
@Override public void onError(Throwable throwable) { try { subscriber.onNext(Result.<R>error(throwable)); } catch (Throwable t) { try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } return; } subscriber.onCompleted(); }
@Override public void call(Subscriber<? super T> subscriber) { try { LazyList<T> lazyList = query.forCurrentThread().listLazyUncached(); try { for (T entity : lazyList) { if (subscriber.isUnsubscribed()) { break; } subscriber.onNext(entity); } } finally { lazyList.close(); } if (!subscriber.isUnsubscribed()) { subscriber.onCompleted(); } } catch (Throwable e) { Exceptions.throwIfFatal(e); subscriber.onError(e); } } });
@Override public void onError(Throwable throwable) { try { subscriber.onNext(Result.<R>error(throwable)); } catch (Throwable t) { try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaHooks.getOnError().call(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); RxJavaHooks.getOnError().call(new CompositeException(t, inner)); } return; } subscriber.onCompleted(); }
void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } } }
@Override public void onNext(Response<R> response) { if (response.isSuccessful()) { subscriber.onNext(response.body()); } else { subscriberTerminated = true; Throwable t = new HttpException(response); try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaHooks.getOnError().call(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); RxJavaHooks.getOnError().call(new CompositeException(t, inner)); } } }
void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException | OnErrorNotImplementedException e) { RxJavaHooks.getOnError().call(e); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); RxJavaHooks.getOnError().call(new CompositeException(t, inner)); } } } }
Exceptions.throwIfFatal(t); try { subscriber.onError(t); } catch (OnCompletedFailedException | OnErrorFailedException