Sanitized and reported to the client as: Match failed [400]

Meteor guide told us:

If the match fails, check throws a Match.Error describing how it failed. If this error gets sent over the wire to the client, it will appear only as Meteor.Error(400, “Match Failed”). The failure details will be written to the server logs but not revealed to the client.

So, how could I show this Exception while invoking method ‘userRegister’ Error: Match error: Match error: Username must be at least 6 characterst to user, not this: Match failed [400]?

Thank you!

Can you wrap the check method in a try-catch structure and catch the Error there, throwing a Meteor error with the text above if the check fails?

What is the check() you’re running that is causing the match to fail? Typically it is just type checking. Not length of string checking.