I’m trying to put together a React update form that displays validation error messages below the various input fields.
I’m using Simple Schema to validate the data. The validation error it throws for an invalid object seems to have a child collection of broken rules, but to only have the human readable message for the first validation error, so if two or more fields are not valid you only get a nicely worded message for the first one.
Is there a way to ask the Schema for the human readable error message for each broken rule?
This is what the validation error contains:
details: Array[2]
0: Object
details: Object
name: "email"
type: “regEx”
1: Object
details: Object
name: "postcode"
type: “maxString”
error: "validation-error"
errorType: "Meteor.Error"
message: "Email must be a valid e-mail address [validation-error]"
reason: “Email must be a valid e-mail address”