-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add meaningful error messages #105
Comments
It's a similar issue when providing a custom predicate; the function can only return a bool so we lose any meaningful reasoning for the error. |
@russellbanks Thanks for reporting this! |
This was recently addressed in #125 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Without using nutype, I use the
thiserror
crate to create Error types and give them relevant error messages:Currently, trying to achieve a similar thing with nutype will just return error messages like "too short". This isn't helpful as I show the error to the user.
Ideally, I'd like for nutype's error to instead say something like
Value is too short. The value length must be between 4 and 128 characters
, or the same message but have a value name, such asPackage version
in my case.The text was updated successfully, but these errors were encountered: