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

Enhance Fail parser with a custom error message #244

Merged
merged 9 commits into from Mar 7, 2023

Conversation

byF
Copy link
Contributor

@byF byF commented Aug 1, 2020

It's useful to have a way how to specify a custom error message for the Fail parser; the current workaround is to throw an exception instead of using the Fail parser.

The implementation is backwards-compatible, the original Fail signature doesn't change and it works the same way as before.
The updated version assumes the user wants to have the access to the custom error message even if ctx.verboseFailures is not true.

Issue: closes #243

@byF byF marked this pull request as ready for review August 1, 2020 09:19
@byF byF changed the title Enhance Fail parser with a custom erro message Enhance Fail parser with a custom error message Aug 1, 2020
@byF
Copy link
Contributor Author

byF commented Aug 9, 2020

Please let me know if you want me to change anything, @lihaoyi

@byF
Copy link
Contributor Author

byF commented Feb 1, 2021

No interest?

@lihaoyi
Copy link
Member

lihaoyi commented Oct 4, 2021

@byF sorry just got to this. Is there any reason you are passing in verboseFailure: Boolean = true as an argument? From the description, the only difference I would expect to see in the new overload would be the custom error message, and I'd expect it to use ctx.verboseFailure just like the original method does

@lihaoyi lihaoyi mentioned this pull request Mar 3, 2023
@@ -3,8 +3,10 @@ target/
out/
.DS_STORE
*.iml
.idea/
.idea
.coursier
Copy link
Member

Choose a reason for hiding this comment

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

Looks unrelated

.bloop/
.metals/
project/metals.sbt
Copy link
Member

Choose a reason for hiding this comment

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

Looks unrelated

@lihaoyi lihaoyi merged commit 947d65e into com-lihaoyi:master Mar 7, 2023
4 of 5 checks passed
@lefou lefou added this to the 3.0.0 milestone Mar 7, 2023
@makkarpov
Copy link

Weirdly enough Fail(msg) version just ignores error message completely. And test is also written to catch default "fail" message, not custom one.

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.

Custom error message in Fail
4 participants