خرید بک لینک

Vote count: 0

I am throwing a Meteor.Error with a custom [reason] like this:

if (Meteor.isServer) {

  Accounts.onCreateUser(function(options, user) {
    ...
    if (emailAlreadyExist === true) {
      throw new Meteor.Error(403, "email already registered");
    } else {
      retu user
    }
  })
}

then trying to show this error message to the user:

if (Meteor.isClient) {
...
    if (error) {
                // Inform the user that account creation failed
                sAlert.error(error.reason);
              }
...
}

But this alert does not show my custom Meteor.Error [reason], it always gives me "Email already exists". What I am doing wrong?

asked 42 secs ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 11 اسفند 1394 ساعت: 5:20

صفحه بندی