mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix accounts error handling
This commit is contained in:
committed by
Ben Newman
parent
72fb8690c0
commit
e04d5f1ada
@@ -1260,9 +1260,9 @@ Ap.insertUserDoc = function (options, user) {
|
||||
// https://jira.mongodb.org/browse/SERVER-3069 will get fixed one day
|
||||
if (e.name !== 'MongoError') throw e;
|
||||
if (e.code !== 11000) throw e;
|
||||
if (e.err.indexOf('emails.address') !== -1)
|
||||
if (e.errmsg.indexOf('emails.address') !== -1)
|
||||
throw new Meteor.Error(403, "Email already exists.");
|
||||
if (e.err.indexOf('username') !== -1)
|
||||
if (e.errmsg.indexOf('username') !== -1)
|
||||
throw new Meteor.Error(403, "Username already exists.");
|
||||
// XXX better error reporting for services.facebook.id duplicate, etc
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user