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

Throw exception in managed task so that it has to be handled or logged. #76

Conversation

OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Mar 3, 2024

To avoid that the exception is swallowed in case there's no ManagedTask listener.
Also add the original exception as the cause to add it to the stacktrace.

To avoid that the exception is swallowed in case there's no ManagedTask listener.
Also add the original exception as the cause to add it to the stacktrace.
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
@arjantijms arjantijms added this to the 3.1.0 milestone Mar 4, 2024
@arjantijms arjantijms merged commit c1a6f9c into eclipse-ee4j:master Mar 4, 2024
1 check passed
@dmatej
Copy link
Contributor

dmatej commented Mar 7, 2024

Just an idea - wouldn't be better it would be some custom exception instead of generic RuntimeException? Or is it worthless in this case?

@OndroMih
Copy link
Contributor Author

OndroMih commented Mar 7, 2024

Everything can be improved. I just focused on throwing an exception that would be swallowed otherwise. It probably doesn't happen often, it only happened to me when I was implementing executors in Concurro using virtual threads when I had a bug there. If it would be something that can regularly happen, then it would deserve a custom exception but have no evidence of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants