Represents an error that occurs during schema validation.
This error is thrown when input data fails to meet the constraints defined by a schema.
const schema = val.string().minLength(3); schema.validate("hi"); // Throws ValidationError // Example error message: // "ValidationError: String Failed Validation for: ✖ String is too short. Minimum length is 3."
Creates a new instance of ValidationError.
ValidationError
throw new ValidationError("Expected a string, but received a number.");
A detailed message describing the validation failure.
Generated using TypeDoc
Represents an error that occurs during schema validation.
This error is thrown when input data fails to meet the constraints defined by a schema.
const schema = val.string().minLength(3); schema.validate("hi"); // Throws ValidationError // Example error message: // "ValidationError: String Failed Validation for: ✖ String is too short. Minimum length is 3."