special message for error sending email
This commit is contained in:
parent
e28047db1b
commit
2f90d7bf30
@ -52,9 +52,9 @@
|
|||||||
code: 406,
|
code: 406,
|
||||||
message: 'User quota exceeded',
|
message: 'User quota exceeded',
|
||||||
},
|
},
|
||||||
COULD_NOT_CREATE: {
|
ERROR_SENDING_EMAIL: {
|
||||||
code: 500,
|
code: 501,
|
||||||
message: 'Could not create profile',
|
message: 'Could not send verification email',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -359,11 +359,11 @@
|
|||||||
emailPlugin.sendVerificationEmail(email, secret, function (err, res) {
|
emailPlugin.sendVerificationEmail(email, secret, function (err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
logger.error('error sending verification email', email, secret, err);
|
logger.error('error sending verification email', email, secret, err);
|
||||||
return callback(emailPlugin.errors.INTERNAL_ERROR);
|
return callback(emailPlugin.errors.ERROR_SENDING_EMAIL);
|
||||||
}
|
}
|
||||||
|
return callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
callback();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -536,10 +536,7 @@
|
|||||||
*/
|
*/
|
||||||
function(callback) {
|
function(callback) {
|
||||||
emailPlugin.saveEncryptedData(email, key, record, function(err) {
|
emailPlugin.saveEncryptedData(email, key, record, function(err) {
|
||||||
if (err) {
|
return callback(err);
|
||||||
return callback(err);
|
|
||||||
}
|
|
||||||
return callback();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -551,17 +548,16 @@
|
|||||||
emailPlugin.createVerificationSecretAndSendEmail(email, function(err) {
|
emailPlugin.createVerificationSecretAndSendEmail(email, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
errorCreating = true;
|
errorCreating = true;
|
||||||
return callback(err);
|
|
||||||
}
|
}
|
||||||
return callback();
|
return callback(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
function(err) {
|
function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (isNewProfile && !isConfirmed && errorCreating) {
|
if (isNewProfile && !isConfirmed && errorCreating) {
|
||||||
emailPlugin.deleteWholeProfile(email, function(err) {
|
emailPlugin.deleteWholeProfile(email, function() {
|
||||||
return emailPlugin.returnError(emailPlugin.errors.COULD_NOT_CREATE, response);
|
return emailPlugin.returnError(err, response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user