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

Idea: Allow custom validation errors #193

Closed
andy128k opened this issue Jan 14, 2021 · 2 comments
Closed

Idea: Allow custom validation errors #193

andy128k opened this issue Jan 14, 2021 · 2 comments

Comments

@andy128k
Copy link
Contributor

Current implementation of an VaidationError stores a String. This forces users to convert errors to a string makes analyzing of custom errors hard.

ValidationError's definition can be changed from ValdationError(String) to ValdationError(Box). The drawback of such change is that std::error::Error is not supported in no_std.

@TedDriggs
Copy link
Collaborator

This is where a custom error type would be useful; the way we emit the error in the validation case would allow for that function to return impl Into<BuildFnError>, and allowing the caller to tell us which error type to use would solve that. See #191 for this.

@andy128k
Copy link
Contributor Author

#194 Solves this issue.

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

No branches or pull requests

2 participants