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

Expose rootCause util #542

Merged
merged 8 commits into from
Jun 28, 2022
Merged

Expose rootCause util #542

merged 8 commits into from
Jun 28, 2022

Conversation

valencik
Copy link
Collaborator

@valencik valencik commented Jun 25, 2022

Resolves #541 by making rootCause publicly available with Exceptions.rootCause but keeps things cross-platform.

cc. @armanbilge

@valencik valencik self-assigned this Jun 25, 2022
@valencik valencik changed the title WIP Expose rootCause util Expose rootCause util Jun 25, 2022
@valencik valencik marked this pull request as ready for review June 25, 2022 17:59
@valencik valencik requested a review from olafurpg June 25, 2022 18:59
Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Can we move this method to some separate object? If it’s intended to be consumed externally then I’d prefer to have it be public (not package private) and on an object so that it’s clearly a stateless method (doesn’t need to live inside a class).

I’d also prefer to keep all the cases of the old implementation. I recall hitting on InvocationTargetException in a lot of cases but it might not have a test case to reproduce it.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

My bad, I missed that it’s a static method. I’d prefer to move the method to a new object named “Exceptions” or something like that. MUnitRunner will no longer be needed for JUnit 5 if that upgrade ever happens.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Approving just to unblock merge in case I miss notifications

valencik added 2 commits June 28, 2022 08:45
Revert "Make rootCause cross-platform without shims"
This reverts commit 106fe8b.
And commit 038e96b.
@valencik
Copy link
Collaborator Author

@armanbilge would you mind taking another peak at this now that cross-compatibility is back in? :)

Copy link
Contributor

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Looks good, the diff is quite small anyway :)

@valencik valencik merged commit ab24df6 into main Jun 28, 2022
@valencik valencik deleted the rootcause branch June 28, 2022 14:25
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.

Simplify and expose munit's rootCause util
3 participants