Documentation

error()

Sets the error message for the previously failed check(s).

error(message: StringConvertible): this;

Notes

Parameters

Return value

This builder, for chaining.

Examples

f.string().error("Not a string");
f.union(f.string(), f.number()).error("Not a string or number");
f.number().error("Not a number").positive().error("Must be positive");

Related