Skip to content

Commit f60ea43

Browse files
committed
catch error sending email
1 parent ef0a62d commit f60ea43

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

plugins/emailstore.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,10 +755,16 @@
755755

756756
var secret = emailPlugin._parseSecret(value);
757757

758-
emailPlugin.sendVerificationEmail(email, secret);
759-
return response.json({
760-
success: true
761-
}).end();
758+
emailPlugin.sendVerificationEmail(email, secret, function (err) {
759+
if (err) {
760+
logger.error('error resending verification email', email, secret, err);
761+
return emailPlugin.returnError(emailPlugin.errors.ERROR_SENDING_EMAIL, response);
762+
}
763+
return response.json({
764+
success: true
765+
}).end();
766+
767+
});
762768
});
763769
});
764770
};

0 commit comments

Comments
 (0)