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

Allow pendingUntilFixed to catch Throwables #1869

Open
wants to merge 3 commits into
base: 3.2.x-new
Choose a base branch
from

Conversation

disordered
Copy link

Some frameworks (ZIO, for example) may result in an error that extends from Throwable directly instead of an Exception when effect is run. Test code then has to be wrapped into an extra try/catch to mark test pending.

If you think catching Throwable is too drastic due to catching fatal errors too, we could add extra patterns for fatal errors, or allow all subtypes of Error to propagate.

@cla-bot
Copy link

cla-bot bot commented Aug 4, 2020

Hi @disordered, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you.

@disordered
Copy link
Author

Hi @disordered, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you.

I reviewed the agreement, and I don't feel like sharing my contact information and address with you guys. You can still use the contribution as you wish, though.

@bvenners
Copy link
Contributor

bvenners commented Aug 4, 2020

@disordered Hmm, curious why does ZIO throw exceptions that Throwable? That seems unidiomatic on the JVM.

@disordered
Copy link
Author

@disordered Hmm, curious why does ZIO throw exceptions that Throwable? That seems unidiomatic on the JVM.

I don't really know. I would have guessed that it is their way to suppress stacktraces (ZIO tracks fiber failures accross threads), but turns out you can suppress stacktrace on exceptions too.

Maybe scaladoc on FiberFailure sheds some light:

Represents a failure in a fiber. This could be caused by some non- recoverable error, such as a defect or system error, by some typed error, or by interruption (or combinations of all of the above).
This class is used to wrap ZIO failures into something that can be thrown, to better integrate with Scala exception handling.

@cla-bot
Copy link

cla-bot bot commented Aug 5, 2020

Hi @disordered, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you.

@cla-bot
Copy link

cla-bot bot commented Aug 5, 2020

Hi @disordered, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you.

@disordered
Copy link
Author

disordered commented Aug 5, 2020

@bvenners I switched the catch to NonFatal instead, which will not catch what scala considers fatal throwables.
They consider InterruptedException fatal, which was caught before, however.

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

2 participants