I noticed that if I throw my own Meteor.Error
in the publish function, Meteor does not pipe any text to standard out. This is good. If I use the check
function in my publish function, it makes the code very clean. Unfortunately, any time check throws, it will spit out the error to the console … I would prefer if it did not.
Two Solutions - Are there better solutions?
//in the top of a publish function, ugly solution.
try {
check(id, Id)
} catch (error) {
throw new Meteor.Error('malformed')
}
//in the top of a publish function, better solution.
if (!Match.test(id,Id)){
throw new Meteor.Error('malformed')
}
The latter solution is better, I think. I would rather there be a way to not have Meteor log the Match.Error thrown in a publish function. Is there something simple I’m missing?
Thanks!