Is there a simple way to change error messages meteor throws?

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: (using this package:

If you want to change the error messages you would have to fork the accounts package you use.

If you rethrow the error like you do now you could save some translation time using

1 Like

If you need internationalization, you should consider using one of the packages available. I use tap:i18n

You will then have language files with your messages translated to the languages you want to support. Whenever you need a translated message, you’d have to invoke the appropriate function with the message key, the currently selected language and possible with options. And that’s it. :slight_smile:

In particular, tap:i18n works both on the client and the server.