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

Should define a Error type rather than generate error type for every struct #43

Closed
yjhmelody opened this issue Jun 26, 2023 · 1 comment

Comments

@yjhmelody
Copy link

yjhmelody commented Jun 26, 2023

The generated error type is not very useful.

@greyblake
Copy link
Owner

The idea of a specific error for every particular struct is that:

  • Looking at the definition of error type one can easily say which validation rules are there
  • It enables exhaustive error handling

In the further versions I am planning to introduce something like GenericValidationError, so every specific validation error will be convertable into GenericValidationError

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