I thought I was using the correct format for check in Meteor.
Assuming a custom message, I’m writing:
check({
value: { type: String, message: ‘Invalid Value’ },
field: { type: String, message: ‘Invalid Field’ },
id: { type: String, message: ‘Invalid Id’ },
});
That format returns a Match error even though the parameters are all strings. If I write it in the simplified format like
check(value, String, field, String, id, String) all is good.
**To clarify, the errors are to be sent to the client. From what I can tell, the meteor zodiase:check package can be used, but with a try/catch block on the server method like this:
try {
check(value, String, ‘Invalid Value’, field, String, ‘Invalid Field’, id, String, ‘Invalid Id’);
} catch (err) {
throw new Meteor.Error(‘’, err.message);
}
The Meteor.Error will be ignored and the specific parameter error will be passed.