-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Optional custom error for constraints? #509
Comments
Agreed. I think this would be useful for any constraint, particularly those where there can be more than one, e.g., I like the
Though I don't have a preference. Tag @Henry-E who I previously discussed this with as well. |
In the case of
vs
but in general, I do not care about symbols if a custom error will be possible. |
Another one that I like in addition to
|
Was hoping for this. Voting for Or possible to have something rustier like : |
Not sure but there might be better error logging in general coming soon
which solves this problem without needing extra syntax
…On Thu, Oct 7, 2021, 4:49 AM acamill ***@***.***> wrote:
Was hoping for this. Voting for ! as it implies unwrapping/error, ?
implies conditional (to me, coming from Swift).
Or possible to have something rustier like :
Constraint = (condition).map_err(Error)? Not very rust savvy
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#509 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAHMGGMZZ2XVOGUNJQKAJDUFUKE5ANCNFSM5AEHSIKQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The custom error would be nice for GUIs perhaps. |
Even for debugging constraintful contextes. Currently offloading so pre checks in "access-control" even if it's not acl related |
Yes would be amazing, I am trying to debug some code, and it's incredibly exhausting trying to understand where the error originated from (i.e. from one of the macros) |
I am currently dodging this by using Would it make sense for clarity sake to have another function similar to Long term most of the arbitrary constraints should be about mint/authority, all these field related to the underlaying "native" types. For the custom stuff it might make more sense to be offloaded somewhere else as in these "parameter_validation" that are purely business logic. |
Closed by #905. |
Sometimes it's can be useful to have a special error code for constraints because this can provide a clear error message. Possible syntax:
Maybe not limited by constraint only?
The text was updated successfully, but these errors were encountered: