Signals a Throwable returned by the callback function for each individual SingleObserver. Scheduler: error does not
(@NonNull Supplier<? extends @NonNull Throwable> supplier)
| 915 | * @return the new {@code Single} instance |
| 916 | */ |
| 917 | @CheckReturnValue |
| 918 | @NonNull |
| 919 | @SchedulerSupport(SchedulerSupport.NONE) |
| 920 | public static <@NonNull T> Single<T> error(@NonNull Supplier<? extends @NonNull Throwable> supplier) { |
| 921 | Objects.requireNonNull(supplier, "supplier is null"); |
| 922 | return RxJavaPlugins.onAssembly(new SingleError<>(supplier)); |
| 923 | } |
| 924 | |
| 925 | /** |
| 926 | * Returns a {@code Single} that invokes a subscriber's {@link SingleObserver#onError onError} method when the |