sendTestMail: return error

This commit is contained in:
Girish Ramakrishnan
2019-04-15 16:47:43 -07:00
parent fa5415b1eb
commit 2f068c66d4
3 changed files with 8 additions and 4 deletions

View File

@@ -204,6 +204,7 @@ function sendTestMail(req, res, next) {
mail.sendTestMail(req.params.domain, req.body.to, function (error) {
if (error && error.reason === MailError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error && error.reason === MailError.EXTERNAL_ERROR) return next(new HttpError(424, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202));