当前位置: 首页>>代码示例>>Java>>正文


Java OnErrorNotImplementedException类代码示例

本文整理汇总了Java中rx.exceptions.OnErrorNotImplementedException的典型用法代码示例。如果您正苦于以下问题:Java OnErrorNotImplementedException类的具体用法?Java OnErrorNotImplementedException怎么用?Java OnErrorNotImplementedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OnErrorNotImplementedException类属于rx.exceptions包,在下文中一共展示了OnErrorNotImplementedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: emitError

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
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);
    }
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:CallArbiter.java

示例2: onNext

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@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);
    }
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:BodyOnSubscribe.java

示例3: onError

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ResultOnSubscribe.java

示例4: onNext

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@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));
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:BodyOnSubscribe.java

示例5: onError

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:ResultOnSubscribe.java

示例6: run

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@Override
public void run() {
    nsBlockOperation.addExecutionBlock(new NSBlockOperation.Block_addExecutionBlock() {
        @Override
        public void call_addExecutionBlock() {
            try {
                action.call();
            } catch (Throwable e) {
                // nothing to do but print a System error as this is fatal and there is nowhere else to throw this
                IllegalStateException ie;
                if (e instanceof OnErrorNotImplementedException) {
                    ie = new IllegalStateException("Exception thrown on Scheduler.Worker thread. Add `onError` handling.", e);
                } else {
                    ie = new IllegalStateException("Fatal Exception thrown on Scheduler.Worker thread.", e);
                }
                RxJavaPlugins.getInstance().getErrorHandler().handleError(ie);
                Thread thread = Thread.currentThread();
                thread.getUncaughtExceptionHandler().uncaughtException(thread, ie);
            } finally {
                unsubscribe();
            }
        }
    });
    operationQueue.addOperation(nsBlockOperation);
}
 
开发者ID:SnowdogApps,项目名称:MoeSampleApp,代码行数:26,代码来源:ScheduledAction.java

示例7: subscribe

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
public final Subscription subscribe(final Action1<? super T> onSuccess) {
    if (onSuccess != null) {
        return subscribe(new Subscriber<T>() {
            public final void onCompleted() {
            }

            public final void onError(Throwable e) {
                throw new OnErrorNotImplementedException(e);
            }

            public final void onNext(T args) {
                onSuccess.call(args);
            }
        });
    }
    throw new IllegalArgumentException("onSuccess can not be null");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:Single.java

示例8: run

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
public void run() {
    try {
        lazySet(Thread.currentThread());
        this.action.call();
    } catch (Throwable e) {
        IllegalStateException ie;
        if (e instanceof OnErrorNotImplementedException) {
            ie = new IllegalStateException("Exception thrown on Scheduler.Worker thread. Add `onError` handling.", e);
        } else {
            ie = new IllegalStateException("Fatal Exception thrown on Scheduler.Worker thread.", e);
        }
        RxJavaPlugins.getInstance().getErrorHandler().handleError(ie);
        Thread thread = Thread.currentThread();
        thread.getUncaughtExceptionHandler().uncaughtException(thread, ie);
    } finally {
        unsubscribe();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:ScheduledAction.java

示例9: create

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
public static final <T> Observer<T> create(final Action1<? super T> onNext) {
    if (onNext != null) {
        return new Observer<T>() {
            public final void onCompleted() {
            }

            public final void onError(Throwable e) {
                throw new OnErrorNotImplementedException(e);
            }

            public final void onNext(T args) {
                onNext.call(args);
            }
        };
    }
    throw new IllegalArgumentException("onNext can not be null");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:Observers.java

示例10: create

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
public static final <T> Subscriber<T> create(final Action1<? super T> onNext) {
    if (onNext != null) {
        return new Subscriber<T>() {
            public final void onCompleted() {
            }

            public final void onError(Throwable e) {
                throw new OnErrorNotImplementedException(e);
            }

            public final void onNext(T args) {
                onNext.call(args);
            }
        };
    }
    throw new IllegalArgumentException("onNext can not be null");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:Subscribers.java

示例11: run

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
@Override
public void run() {
    try {
        action.call();
    } catch (Throwable e) {
        // nothing to do but print a System error as this is fatal and there is nowhere else to throw this
        IllegalStateException ie;
        if (e instanceof OnErrorNotImplementedException) {
            ie = new IllegalStateException("Exception thrown on Scheduler.Worker thread. Add `onError` handling.", e);
        } else {
            ie = new IllegalStateException("Fatal Exception thrown on Scheduler.Worker thread.", e);
        }
        RxJavaPlugins.getInstance().getErrorHandler().handleError(ie);
        Thread thread = Thread.currentThread();
        thread.getUncaughtExceptionHandler().uncaughtException(thread, ie);
    }
}
 
开发者ID:M4lik,项目名称:burning-series,代码行数:18,代码来源:LooperScheduler.java

示例12: schedulePeriodicSync

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
private void schedulePeriodicSync(Sync sync) {

    if (isSyncScheduled(sync.getId())) {
      return;
    }

    subscriptionStorage.put(sync.getId(),
        Observable.interval(sync.getTrigger(), sync.getInterval(), TimeUnit.MILLISECONDS)
            .switchMap(__ -> sync.execute()
                .doOnError(throwable -> consoleLogger.log(throwable))
                .onErrorComplete()
                .toObservable())
            .subscribe(__ -> {
            }, throwable -> {
              throw new OnErrorNotImplementedException(throwable);
            }));
  }
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:18,代码来源:RxSyncScheduler.java

示例13: split

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
/**
 * Returns an {@link Action1} that can be used to split {@link Notification} to appropriate
 * dematerialized onNext and onError calls.
 *
 * @param onNext  a method that will be called in case of onNext notification, or null.
 * @param onError a method that will be called in case of onError notification, or null.
 * @param <T>     a type of onNext value.
 * @return an {@link Action1} that can be used to split a {@link Notification} into appropriate
 * onNext, onError calls.
 */
public static <T> Action1<Notification<T>> split(
    @Nullable final Action1<T> onNext,
    @Nullable final Action1<Throwable> onError) {

    return new Action1<Notification<T>>() {
        @Override
        public void call(Notification<T> notification) {
            if (notification.isOnNext()) {
                if (onNext != null)
                    onNext.call(notification.getValue());
            }
            else if (notification.isOnError()) {
                if (onError != null)
                    onError.call(notification.getThrowable());
                else
                    throw new OnErrorNotImplementedException(notification.getThrowable());
            }
        }
    };
}
 
开发者ID:konmik,项目名称:satellite,代码行数:31,代码来源:RxNotification.java

示例14: OBSERVER_ONERROR_NOTIMPLEMENTED

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
private static Subscriber<String> OBSERVER_ONERROR_NOTIMPLEMENTED() {
    return new Subscriber<String>() {

        @Override
        public void onComplete() {

        }

        @Override
        public void onError(Throwable e) {
            throw new OnErrorNotImplementedException(e);
        }

        @Override
        public void onNext(String args) {

        }

    };
}
 
开发者ID:akarnokd,项目名称:RxJavaFlow,代码行数:21,代码来源:SafeObserverTest.java

示例15: simulate

import rx.exceptions.OnErrorNotImplementedException; //导入依赖的package包/类
/**
 * Run a simulation of 'count' selects and update the clients
 * @param strategy
 * @param N
 * @param count
 * @return
 * @throws Throwable 
 */
static Integer[] simulate(LoadBalancer<IntClientAndMetrics> lb, int N, int count) throws Throwable {
    // Set up array of counts
    final Integer[] counts = new Integer[N];
    for (int i = 0; i < N; i++) {
        counts[i] = 0;
    }

    // Run simulation
    for (int i = 0; i < count; i++) {
        try {
            lb.toObservable().subscribe(new Action1<IntClientAndMetrics>() {
                @Override
                public void call(IntClientAndMetrics t1) {
                    counts[t1.getClient()] = counts[t1.getClient()] + 1;
                }
            });
        }
        catch (OnErrorNotImplementedException e) {
            throw e.getCause();
        }
    }
    return counts;
}
 
开发者ID:Netflix,项目名称:ocelli,代码行数:32,代码来源:BaseWeightingStrategyTest.java


注:本文中的rx.exceptions.OnErrorNotImplementedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。