Common interface for all validation errors.
kind
stringIdentifies the kind of error.
message
string | undefinedHuman readable error message.
ValidationError.WithField
interfaceValidation error with a field.
This is returned from field state, e.g., catField.errors() would be of a list of errors with
field: catField bound to state.
ValidationError.WithOptionalField
interfaceValidation error with optional field.
This is generally used in places where the result might have a field.
e.g., as a result of a validateTree, or when handling form submission.
ValidationError.WithoutField
interfaceValidation error with no field.
This is used to strongly enforce that fields are not allowed in validation result.
Description
Common interface for all validation errors.
This can be returned from validators.
It's also used by the creation functions to create an instance
(e.g. requiredError, minError, etc.).
Jump to details