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

2.x: Update Error Handling Operators docs #6266

Merged
merged 6 commits into from
Oct 30, 2018

Conversation

lorenzpahl
Copy link
Contributor

This PR updates the Error-Handling-Operators.md wiki page as per issue #6132:

  • Update operator list
  • Add examples

The page now follows the structure that was defined in #6131.

@codecov
Copy link

codecov bot commented Oct 29, 2018

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6266      +/-   ##
============================================
+ Coverage     98.25%   98.26%   +0.01%     
- Complexity     6206     6208       +2     
============================================
  Files           667      667              
  Lines         44905    44905              
  Branches       6228     6228              
============================================
+ Hits          44121    44126       +5     
- Misses          239      243       +4     
+ Partials        545      536       -9
Impacted Files Coverage Δ Complexity Δ
...l/operators/observable/ObservableFlatMapMaybe.java 88.23% <0%> (-7.85%) 2% <0%> (ø)
...ternal/operators/observable/ObservablePublish.java 94.69% <0%> (-3.54%) 11% <0%> (ø)
...ernal/operators/flowable/FlowableFromIterable.java 95.18% <0%> (-2.14%) 5% <0%> (ø)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...internal/operators/flowable/FlowableSwitchMap.java 95.28% <0%> (-1.89%) 3% <0%> (ø)
...java/io/reactivex/processors/PublishProcessor.java 98.19% <0%> (-1.81%) 42% <0%> (-1%)
...x/internal/operators/flowable/FlowablePublish.java 97.02% <0%> (-1.71%) 11% <0%> (ø)
...perators/mixed/ObservableSwitchMapCompletable.java 98.94% <0%> (-1.06%) 3% <0%> (ø)
...ernal/operators/flowable/FlowableTimeoutTimed.java 98.37% <0%> (-0.82%) 3% <0%> (ø)
...x/internal/operators/flowable/FlowableGroupBy.java 95.51% <0%> (-0.57%) 3% <0%> (ø)
... and 21 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 76abb7b...0cc7585. Read the comment docs.

@akarnokd akarnokd added this to the 2.2 backlog milestone Oct 29, 2018
Copy link
Contributor

@artem-zinnatullin artem-zinnatullin left a comment

Choose a reason for hiding this comment

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

This is really good, but few comments

.doOnError(error -> System.err.println("The error message is: " + error.getMessage()))
.subscribe(
x -> System.out.println("This should never be printed!"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's be more clear for newcomers here with something like: "onNext should never be printed!"

x -> System.out.println("This should never be printed!"),
Throwable::printStackTrace,
() -> System.out.println("This should never be printed!"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar cases below, don't want to mention them all with separate comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Included the "onNext" etc. in the print statements.

**ReactiveX documentation:** [http://reactivex.io/documentation/operators/catch.html](http://reactivex.io/documentation/operators/catch.html)

When the reactive type signals an error event, the error will be swallowed and replaced by a complete event.
Copy link
Contributor

Choose a reason for hiding this comment

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

"by a completion event"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it.

**ReactiveX documentation:** [http://reactivex.io/documentation/operators/catch.html](http://reactivex.io/documentation/operators/catch.html)

Instructs a reactive type to emit a sequence of items if it encounters an error.
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistency here compared to descriptions above, they started with

When the reactive type signals an error event

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest to stick to one or another style

Copy link
Contributor

Choose a reason for hiding this comment

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

"Instructs …" is actually pretty good and concise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it to use "Instructs ..." in all descriptions.

docs/Error-Handling-Operators.md Outdated Show resolved Hide resolved
```

## retry
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason that sytnax highlighting breaks here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why this happens (BTW this already happens in line 170; the triple backticks should also be blue). Locally, in VS Code the highlighting of the Markdown looks correct.

@akarnokd akarnokd merged commit fba8b61 into ReactiveX:2.x Oct 30, 2018
@lorenzpahl lorenzpahl deleted the docs/error-handling-operators branch October 30, 2018 15:43
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.

4 participants