File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
src/main/java/io/reactivex
internal/operators/completable Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,13 @@ public static <T> Completable fromMaybe(final MaybeSource<T> maybe) {
508508 * <dl>
509509 * <dt><b>Scheduler:</b></dt>
510510 * <dd>{@code fromRunnable} does not operate by default on a particular {@link Scheduler}.</dd>
511+ * <dt><b>Error handling:</b></dt>
512+ * <dd> If the {@link Runnable} throws an exception, the respective {@link Throwable} is
513+ * delivered to the downstream via {@link CompletableObserver#onError(Throwable)},
514+ * except when the downstream has disposed this {@code Completable} source.
515+ * In this latter case, the {@code Throwable} is delivered to the global error handler via
516+ * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}.
517+ * </dd>
511518 * </dl>
512519 * @param run the runnable to run for each subscriber
513520 * @return the new Completable instance
Original file line number Diff line number Diff line change 1717import io .reactivex .disposables .*;
1818import io .reactivex .exceptions .Exceptions ;
1919import io .reactivex .functions .Action ;
20+ import io .reactivex .plugins .RxJavaPlugins ;
2021
2122public final class CompletableFromAction extends Completable {
2223
@@ -36,6 +37,8 @@ protected void subscribeActual(CompletableObserver observer) {
3637 Exceptions .throwIfFatal (e );
3738 if (!d .isDisposed ()) {
3839 observer .onError (e );
40+ } else {
41+ RxJavaPlugins .onError (e );
3942 }
4043 return ;
4144 }
Original file line number Diff line number Diff line change 1818import io .reactivex .disposables .Disposable ;
1919import io .reactivex .disposables .Disposables ;
2020import io .reactivex .exceptions .Exceptions ;
21+ import io .reactivex .plugins .RxJavaPlugins ;
2122
2223public final class CompletableFromRunnable extends Completable {
2324
@@ -37,6 +38,8 @@ protected void subscribeActual(CompletableObserver observer) {
3738 Exceptions .throwIfFatal (e );
3839 if (!d .isDisposed ()) {
3940 observer .onError (e );
41+ } else {
42+ RxJavaPlugins .onError (e );
4043 }
4144 return ;
4245 }
You can’t perform that action at this time.
0 commit comments