-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If an error occurs when creating a user, a more kind error message is necessary #290
Comments
InvestigationThe error message is written in the view. <pre>{% for cUser in createdUser %}{% if cUser.user %}{{ cUser.email }} {{ cUser.password }}<br>{% else %}{{ cUser.email }} 作成失敗<br>{% endif %}{% endfor %}</pre> And it's displayed only if The action sets When there's a user already existing: User.findOne({ email: email }, function(err, userData) {
// The user is exists
if (userData) {
createdUserList.push({
email: email,
password: null,
user: null,
}) When failed to save a new user: newUser.save(function(err, userData) {
if (err) {
createdUserList.push({
email: email,
password: null,
user: null,
})
debug('save failed!! ', email) This eventually causes false-failure; failed to create a new user but succeeded the model creation(User.createUsersByInvitation). Currently, always return callback(null, createdUserList) SolutionsIt will be nice to pass an error to the caller in Maybe you can use a promise instead of |
About
Reproduce
Admin
->ユーザー管理
menu[email protected]
- The error has come with `作成失敗` message
- But, I don't know why the error occured
The text was updated successfully, but these errors were encountered: