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

Documentation and custom ErrorHandler for Single.fromCallable(.) #6183

Closed
wants to merge 1 commit into from
Closed

Conversation

brainbytes42
Copy link

Relating to #6178, a proposal for a solution containing a custom ErrorHandler.

  • Added doc for Single.fromCallable(.) to clarify on handling of
    UndeliverableExceptions.
  • Proposing custom ErrorHandler for Single.fromCallable to have a more
    granular Interface than just to have some global RxJavaPlugins class,
    which handles UndeliverableExceptions. They shouldn't be swallowed, if
    they aren't expected, but for expected ones, it should be possible to
    handle them individually.

If approved, this should be extended to Observable, etc.

Thank you for contributing to RxJava. Before pressing the "Create Pull Request" button, please consider the following points:

  • [ ✔ ] Please give a description about what and why you are contributing, even if it's trivial.

  • [ ✔ ] Please include the issue list number(s) or other PR numbers in the description if you are contributing in response to those.

  • [ ✔ ] Please include a reasonable set of unit tests if you contribute new code or change an existing one. If you contribute an operator, (if applicable) please make sure you have tests for working with an empty, just, range of values as well as an error source, with and/or without backpressure and see if unsubscription/cancellation propagates correctly.

- Added doc for Single.fromCallable(.) to clarify on handling of
UndeliverableExceptions.
- Proposing custom ErrorHandler for Single.fromCallable to have a more
granular Interface than just to have some global RxJavaPlugins class,
which handles UndeliverableExceptions. They shouldn't be swallowed, if
they aren't expected, but for expected ones, it should be possible to
handle them individually.

If approved, this should be extended to Observable, etc.
@akarnokd
Copy link
Member

Updating the docs is fine, provided you go along the line proposed by #6179.

However, I don't support adding a new overload and changing the existing operator implementation.

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.

Please just update the docs only.

@brainbytes42
Copy link
Author

ok, never mind - would just have been useful... will have to continue using "workarounds" then...

@akarnokd
Copy link
Member

You could implement it yourself the way you see fit, even taking RXJava's implementation by source and having it in your project/library.

@brainbytes42
Copy link
Author

yeah - and rebasing each and every new "original" version? no thanks... ;-)
(which means, it's good that this project is actively maintained - I just don't get, what's bad on not having to fumble with some global ErrorHandling or otherwise not being able to use fromCallable with callables throwing Exceptions as their signature allows... The other way around using create works, but why do we need fromCallable then? In my opinion, thats not consistent then.)

@akarnokd
Copy link
Member

yeah - and rebasing each and every new "original" version? no thanks... ;-)

Assuming this PR would have been accepted, doesn't it mean you'd have to go around and add all those handlers anyway?

The other way around using create works, but why do we need fromCallable then? In my opinion, thats not consistent then.)

Just because you don't see the value of some operator, it doesn't mean its superfluous. Unfortunately, many would see RxJava tailored to their exact local needs, which is generally unsustainable.

@akarnokd akarnokd closed this Aug 28, 2018
@brainbytes42
Copy link
Author

yup, but that would be once.

For my local needs, I built my own extensions - I was asking for tailoring to JAva-Specification, wich has Callable throwing an Exception. (Not allowing an Exception would mean forcing a return-value, even if cancelled...) But it's ok, I built another utility-class to fix that issue on my own.

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.

2 participants