Uh oh!
There was an error while loading. Please reload this page.
Fix feature matcher when feature throws - #296
Conversation
sf105
commented
Apr 19, 2020
Thanks for contributing. I disagree with this one because if there's an exception at this level, then it's not a mismatch, but something is deeply broken and we should stop immediately. |
alb-i986
commented
Apr 19, 2020
Well, for the toString method, you have a point. But we can't say that in general. |
sf105
commented
Apr 19, 2020
I would argue that that is different, because it reports a known possible failure that is in the domain of the matcher. For generic feature matchers, it's harder to make universal decisions. If you wanted to enforce consistency, I'd rather remove the exception handling from the file matcher. What does the additional complexity handling of the exception do to improve the user's experience? |
alb-i986
commented
Apr 19, 2020
This is really where we disagree. I believe it's a "user space" issue, instead. Not a Matcher problem. It's the same concept as throwing in matchesSafely() if the method for matching throws. |
nhojpatrick
commented
Jun 29, 2020
@alb-i986 please can you rebase from master, as |
f805546 to
67452d1CompareRight now, that may happen in: - HasToString, if the actual object has a custom toString method which may throw - FileMatchers.aFileWithCanonicalPath and siblings
67452d1 to
97e8b93Comparealb-i986
commented
Aug 23, 2020
Rebased and squashed. Ready to be merged. |
nhojpatrick
commented
Feb 13, 2022
Going to try and kick start hamcrest, so if you want to get it merged, please rebase from the branch |
9bc653b to
e9f7fc8Compare
While working on #294 I noticed that
FeatureMatcher#featureValueOfmay throw.Right now, that may happen in:
I'm gonna squash as soon as you review.