From ea52ed83f77c0eac43f8f0c6c7c4b10a87c72276 Mon Sep 17 00:00:00 2001 From: luis Date: Sat, 1 Sep 2018 15:16:23 -0400 Subject: [PATCH 1/4] #6179 Adding Error handling javadocs to Observable#fromCallable(), Single#fromCallable(), and Completable#fromCallable(). --- src/main/java/io/reactivex/Completable.java | 7 +++++++ src/main/java/io/reactivex/Observable.java | 8 +++++++- src/main/java/io/reactivex/Single.java | 7 +++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java index 6cf5aa75f4..d5f4511d6c 100644 --- a/src/main/java/io/reactivex/Completable.java +++ b/src/main/java/io/reactivex/Completable.java @@ -416,6 +416,13 @@ public static Completable fromAction(final Action run) { *
*
Scheduler:
*
{@code fromCallable} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Callable} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link CompletableObserver#onError(Throwable)}, + * except when the downstream has canceled or disposed this {@code Completable} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
*
* @param callable the callable instance to execute for each subscriber * @return the new Completable instance diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index d1adc46efa..b760c5e095 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -1757,8 +1757,14 @@ public static Observable fromArray(T... items) { *
*
Scheduler:
*
{@code fromCallable} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Callable} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link Observer#onError(Throwable)}, + * except when the downstream has canceled or disposed this {@code Observable} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
*
- * * @param supplier * a function, the execution of which should be deferred; {@code fromCallable} will invoke this * function only when an observer subscribes to the ObservableSource that {@code fromCallable} returns diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index 51a896c887..95576ad2b3 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -583,6 +583,13 @@ public static Single error(final Throwable exception) { *
*
Scheduler:
*
{@code fromCallable} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Callable} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link SingleObserver#onError(Throwable)}, + * except when the downstream has canceled or disposed this {@code Single} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
*
* * @param callable From ee99e0bbd1c8d8db8124e3245a5b3db2b32023f2 Mon Sep 17 00:00:00 2001 From: luis Date: Sat, 1 Sep 2018 21:23:09 -0400 Subject: [PATCH 2/4] #6179 Adding Error handling javadocs to Maybe#fromAction() and Completable#fromAction(). --- src/main/java/io/reactivex/Completable.java | 7 +++++++ src/main/java/io/reactivex/Maybe.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java index d5f4511d6c..e36eadb808 100644 --- a/src/main/java/io/reactivex/Completable.java +++ b/src/main/java/io/reactivex/Completable.java @@ -396,6 +396,13 @@ public static Completable error(final Throwable error) { *
*
Scheduler:
*
{@code fromAction} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Action} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link CompletableObserver#onError(Throwable)}, + * except when the downstream has canceled or disposed this {@code Completable} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
*
* @param run the runnable to run for each subscriber * @return the new Completable instance diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index 8750c83cd2..5c0eed5cbf 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -657,6 +657,13 @@ public static Maybe error(Callable supplier) { *
*
Scheduler:
*
{@code fromAction} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Action} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link MaybeObserver#onError(Throwable)}, + * except when the downstream has canceled or disposed this {@code Maybe} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
*
* @param the target type * @param run the runnable to run for each subscriber From 58f3909b83e16a0ac74ada80e436aed4ef648901 Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 2 Sep 2018 08:38:19 -0400 Subject: [PATCH 3/4] #6179 Removing cancellation language since only the `Flowable` type has `cancel()` --- src/main/java/io/reactivex/Completable.java | 4 ++-- src/main/java/io/reactivex/Maybe.java | 2 +- src/main/java/io/reactivex/Observable.java | 2 +- src/main/java/io/reactivex/Single.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java index e36eadb808..430440b248 100644 --- a/src/main/java/io/reactivex/Completable.java +++ b/src/main/java/io/reactivex/Completable.java @@ -399,7 +399,7 @@ public static Completable error(final Throwable error) { *
Error handling:
*
If the {@link Action} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link CompletableObserver#onError(Throwable)}, - * except when the downstream has canceled or disposed this {@code Completable} source. + * except when the downstream has disposed this {@code Completable} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. *
@@ -426,7 +426,7 @@ public static Completable fromAction(final Action run) { *
Error handling:
*
If the {@link Callable} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link CompletableObserver#onError(Throwable)}, - * except when the downstream has canceled or disposed this {@code Completable} source. + * except when the downstream has disposed this {@code Completable} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. *
diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index 5c0eed5cbf..be9c888762 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -660,7 +660,7 @@ public static Maybe error(Callable supplier) { *
Error handling:
*
If the {@link Action} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link MaybeObserver#onError(Throwable)}, - * except when the downstream has canceled or disposed this {@code Maybe} source. + * except when the downstream has disposed this {@code Maybe} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. *
diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index b760c5e095..541c15215c 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -1760,7 +1760,7 @@ public static Observable fromArray(T... items) { *
Error handling:
*
If the {@link Callable} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link Observer#onError(Throwable)}, - * except when the downstream has canceled or disposed this {@code Observable} source. + * except when the downstream has disposed this {@code Observable} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. *
diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index 95576ad2b3..dca4eb9ed0 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -586,7 +586,7 @@ public static Single error(final Throwable exception) { *
Error handling:
*
If the {@link Callable} throws an exception, the respective {@link Throwable} is * delivered to the downstream via {@link SingleObserver#onError(Throwable)}, - * except when the downstream has canceled or disposed this {@code Single} source. + * except when the downstream has disposed this {@code Single} source. * In this latter case, the {@code Throwable} is delivered to the global error handler via * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. *
From 5c1eeb92dfeb432743e2da7e2e395348a53d134b Mon Sep 17 00:00:00 2001 From: luis Date: Sun, 2 Sep 2018 08:46:16 -0400 Subject: [PATCH 4/4] #6179 Adding error handling JavaDocs to Flowable#fromCallable() --- src/main/java/io/reactivex/Flowable.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index bab8443357..549166dfac 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -1955,6 +1955,13 @@ public static Flowable fromArray(T... items) { *
The operator honors backpressure from downstream.
*
Scheduler:
*
{@code fromCallable} does not operate by default on a particular {@link Scheduler}.
+ *
Error handling:
+ *
If the {@link Callable} throws an exception, the respective {@link Throwable} is + * delivered to the downstream via {@link Subscriber#onError(Throwable)}, + * except when the downstream has canceled this {@code Flowable} source. + * In this latter case, the {@code Throwable} is delivered to the global error handler via + * {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}. + *
* * * @param supplier