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

Better error message when a value doesn't satisfy the predicate #104

Open
fthomas opened this issue Dec 12, 2015 · 3 comments
Open

Better error message when a value doesn't satisfy the predicate #104

fthomas opened this issue Dec 12, 2015 · 3 comments

Comments

@fthomas
Copy link
Owner

fthomas commented Dec 12, 2015

This tweet https://twitter.com/ppurang/status/674252856720031745 indicates that we could improve the error message when a value doesn't satisfy the predicate.

@fthomas
Copy link
Owner Author

fthomas commented Mar 23, 2016

I tend to change the error message from Predicate failed: (4 > 6) to something like Predicate failed: (x > 6) where x = 4. That should help to keep apart the predicate and the value that didn't satisfy it.

@LMnet
Copy link

LMnet commented Mar 2, 2019

One more example of a strange error message:

@ string.NonEmptyString.from("foo") 
res2: Either[String, string.NonEmptyString] = Right(foo)

@ string.NonEmptyString.from("") 
res3: Either[String, string.NonEmptyString] = Left("Predicate isEmpty() did not fail.")

@SinarPandora
Copy link

Yes, I was misled today by this strange error message - it expresses the opposite of the actual problem.

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

No branches or pull requests

3 participants