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

Exception handling in streams #59

Open
jroper opened this issue Jul 4, 2018 · 4 comments
Open

Exception handling in streams #59

jroper opened this issue Jul 4, 2018 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@jroper
Copy link
Member

jroper commented Jul 4, 2018

All of the streams callbacks are using java.util.function.*, which don't allow throwing checked exceptions. Should we allow streams to be completed with checked exceptions, by providing a wrapper unchecked exception that gets unwrapped when caught? java.util.concurrent.CompletionException could be a candidate to use.

One argument for not doing this is that CompletionStage doesn't do it, so it may worth being consistent in behavior with CompletionStage. On the other hand, it's much nicer for users to not have to unwrap exceptions.

@jroper jroper added the streams label Jul 4, 2018
@Emily-Jiang
Copy link
Member

I don't quite understand your use case here. Please elaborate more. Introducing something inconsistence to the CompletionStage will confuse users.

@jroper jroper removed the streams label Aug 10, 2018
@cescoffier
Copy link
Contributor

On this topic I recent found https://github.com/pivovarit/throwing-function.

We may want to come up with our own Exception as it would be part of the contract and not a bad/odd usage of CompletionException.

@cescoffier cescoffier added the enhancement New feature or request label Nov 6, 2018
@Emily-Jiang
Copy link
Member

How about defining our own exception ReactiveStreamsCompletionException?

@jroper jroper added this to the 1.1 milestone Nov 6, 2018
@Emily-Jiang
Copy link
Member

Based on @cescoffier , he implemented on mutiny but it is not useful.

@Emily-Jiang Emily-Jiang modified the milestones: 1.1, 2.0 Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants