I’m trying to change the error message that is send to my client when he’s trying to create a new account.
My users speak spanish so the custom message that is thrown doesn’t work for me since it is in english.
My current workaround is doing this:
try {
Medico.registrar(email, password, datosPersonales);
} catch (error) {
if (error.error == EMAIL_ALREADY_EXISTS) {
throw new Meteor.Error("Ya existe una cuenta con este correo");
}
throw new Meteor.Error(error);
}
However I was wondering if there is a way to customize all error messages in a simple way, kind of what simpleSchema does here: https://github.com/aldeed/simpl-schema#customizing-validation-messages (using this package: https://github.com/aldeed/js-message-box)