Java Code Examples for rx.plugins.RxJavaHooks#onError()
The following examples show how to use
rx.plugins.RxJavaHooks#onError() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RateLimitedBatcher.java From titus-control-plane with Apache License 2.0 | 6 votes |
/** * ensure onError is only called if onCompleted was not (the {@link Observable} contract). Since it is a * terminal event, {@link Scheduler.Worker#unsubscribe()} is called. */ private void sendError(Throwable e) { if (sentError || sentCompleted) { logger.error("Another terminal event was already sent, emitting as undeliverable", e); RxJavaHooks.onError(e); return; } sentError = true; /* * setting done is not strictly necessary since the error tracking above should be enough to stop periodic * scheduling, but it is here for completeness */ done = true; downstream.onError(e); worker.shutdown(); }
Example 2
Source File: RxMobius.java From mobius with Apache License 2.0 | 5 votes |
public Action1<Throwable> call(final Transformer<? extends F, E> effectHandler) { return new Action1<Throwable>() { @Override public void call(Throwable throwable) { RxJavaHooks.onError( new ConnectionException(effectHandler.getClass().toString(), throwable)); } }; }
Example 3
Source File: RateLimitedBatcher.java From titus-control-plane with Apache License 2.0 | 5 votes |
/** * schedule an error to be sent and interrupt pending work */ public void offerError(Throwable e) { if (isOnErrorScheduled || sentError || sentCompleted) { logger.error("Another terminal event was already sent, emitting as undeliverable", e); RxJavaHooks.onError(e); return; } isOnErrorScheduled = true; worker.schedule(ACTION_ERROR, () -> sendError(e)); }
Example 4
Source File: RxValve.java From RXBus with Apache License 2.0 | 5 votes |
@Override public void onError(Throwable e) { if (ExceptionsUtils.addThrowable(error, e)) { other.unsubscribe(); done = true; drain(); } else { RxJavaHooks.onError(e); } }
Example 5
Source File: RxValve.java From RXBus with Apache License 2.0 | 5 votes |
void otherError(Throwable e) { if (ExceptionsUtils.addThrowable(error, e)) { unsubscribe(); done = true; drain(); } else { RxJavaHooks.onError(e); } }
Example 6
Source File: AutoRemoveSubscription.java From akarnokd-misc with Apache License 2.0 | 5 votes |
public static <T> void subscribeAutoRelease( Observable<T> source, final Action1<T> onNext, CompositeSubscription composite) { Subscriber<T> subscriber = new Subscriber<T>() { @Override public void onCompleted() { composite.remove(this); } @Override public void onError(Throwable e) { composite.remove(this); RxJavaHooks.onError(e); } @Override public void onNext(T t) { try { onNext.call(t); } catch (Throwable ex) { unsubscribe(); onError(ex); } } }; composite.add(subscriber); source.subscribe(subscriber); }
Example 7
Source File: OrderedMerge.java From rxjava-extras with Apache License 2.0 | 5 votes |
@Override public void onError(Throwable e) { if (done) { RxJavaHooks.onError(e); return; } done = true; parent.error(e); }
Example 8
Source File: ResourceManager.java From rxjava-extras with Apache License 2.0 | 5 votes |
@Override public void call(Closeable c) { try { c.close(); } catch (IOException e) { RxJavaHooks.onError(e); } }