Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "error handling" java docs section to from callable & co #6193

Conversation

luis-cortes
Copy link
Contributor

@luis-cortes luis-cortes commented Sep 2, 2018

Resolves #6179

Added JavaDocs describing the regular and canceled/disposed behavior for

  • Observable.fromCallable()
  • Single.fromCallable()
  • Maybe.fromAction()
  • Completable.fromCallable()
  • Completable.fromAction()
  • Flowable.fromCallable()

Did not alter Maybe.fromCallable() because the existing JavaDoc appears to be adequate.

luis added 2 commits September 1, 2018 21:18
…ble(), Single#fromCallable(), and Completable#fromCallable().
@codecov
Copy link

codecov bot commented Sep 2, 2018

Codecov Report

Merging #6193 into 2.x will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6193      +/-   ##
============================================
- Coverage     98.22%   98.21%   -0.02%     
- Complexity     6197     6199       +2     
============================================
  Files           667      667              
  Lines         44888    44888              
  Branches       6218     6218              
============================================
- Hits          44091    44086       -5     
- Misses          253      259       +6     
+ Partials        544      543       -1
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Flowable.java 100% <ø> (ø) 566 <0> (ø) ⬇️
src/main/java/io/reactivex/Completable.java 100% <ø> (ø) 117 <0> (ø) ⬇️
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 541 <0> (ø) ⬇️
src/main/java/io/reactivex/Maybe.java 100% <ø> (ø) 171 <0> (ø) ⬇️
src/main/java/io/reactivex/Single.java 100% <ø> (ø) 146 <0> (ø) ⬇️
...l/operators/observable/ObservableFlatMapMaybe.java 86.27% <0%> (-9.81%) 2% <0%> (ø)
...reactivex/internal/operators/single/SingleAmb.java 96.36% <0%> (-3.64%) 9% <0%> (-1%)
...rnal/operators/flowable/FlowableSkipLastTimed.java 95.91% <0%> (-2.05%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableFromIterable.java 95.18% <0%> (-1.07%) 5% <0%> (ø)
...perators/mixed/ObservableSwitchMapCompletable.java 98.94% <0%> (-1.06%) 3% <0%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7d91c6...5c1eeb9. Read the comment docs.

Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small adjustments would be great. Could you also update Flowable.fromCallable?

* <dt><b>Error handling:</b></dt>
* <dd> 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"downstream has disposed this" as only Flowables have cancel.

* <dt><b>Error handling:</b></dt>
* <dd> 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"downstream has disposed this"

* <dt><b>Error handling:</b></dt>
* <dd> 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"downstream has disposed this"

* <dt><b>Error handling:</b></dt>
* <dd> 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"downstream has disposed this"

* <dt><b>Error handling:</b></dt>
* <dd> 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"downstream has disposed this"

@luis-cortes
Copy link
Contributor Author

I noticed that there's quite a bit more of the "cancellation" language in the other areas.
For example:

  • Single.java:833 ...and all other source {@code SingleSource}s are cancelled.
  • Completable.java:1588 * @param onFinally the action called when this Completable terminates or gets cancelled

Should this be added to #4535?

@akarnokd
Copy link
Member

akarnokd commented Sep 2, 2018

Post a separate PR for those.

@luis-cortes
Copy link
Contributor Author

Should I create a separate issue as well?

Also, is there anything else you need from me to get this PR merged (unsure of the process at this point)?

@akarnokd
Copy link
Member

akarnokd commented Sep 2, 2018

No need to open an issue for that.

We are waiting for another approval and this will be merged.

@akarnokd akarnokd merged commit e0532b7 into ReactiveX:2.x Sep 3, 2018
Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 missed it

@luis-cortes luis-cortes deleted the Add-"Error-handling"-JavaDocs-section-to-fromCallable-&-co branch September 4, 2018 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants