HI,
Can anyone help to explain the following chappter from meteor doc? what do “mapped to a sanitized version on the wire” and “sanitizedError field” mean?
I understand how to create an Meteor.Error and have it returned to the client, but I just want to understand this part so that I can be sure there won’t be any traps.
Thanks for your help!
If a method function throws a different exception, then it will be mapped to a sanitized version on the wire. Specifically, if the sanitizedError field on the thrown error is set to a Meteor.Error, then that error will be sent to the client. Otherwise, if no sanitized version is available, the client gets Meteor.Error(500, ‘Internal server error’).