cloudflare: Fix crash when there is an external error updating dns records

This commit is contained in:
Girish Ramakrishnan
2018-09-06 12:26:11 -07:00
parent 5e919b90f5
commit df66d77a68
3 changed files with 10 additions and 5 deletions

View File

@@ -88,6 +88,7 @@ function setDnsRecords(req, res, next) {
mail.setDnsRecords(req.params.domain, 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(503, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(201));