-
Notifications
You must be signed in to change notification settings - Fork 37
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 specifying an error message in &requires
#1856
Comments
Quick thought: I'd be reluctant to special-case |
To surface more useful errors we allow specifying an error message for
assert
statements, e.g.,We could consider adding support for similar syntax for
&requires
, e.g.,To tweak messages for
&requires
one currently needs to use a field hook. Moving this to&requires
seems natural and we already support multiple&requires
attributes.The current syntax is
&requires=COND
and above idea would be to add support for&requires=(COND [: EXPR_MSG])
. We already can parse parentheses aroundCOND
so they might not be strictly needed.The text was updated successfully, but these errors were encountered: