detect dashboard domain conflict with existing app

Fixes #620
This commit is contained in:
Girish Ramakrishnan
2019-03-18 19:13:44 -07:00
parent 76ec639fea
commit add954db80
2 changed files with 20 additions and 4 deletions

View File

@@ -167,6 +167,7 @@ function prepareDashboardDomain(req, res, next) {
cloudron.prepareDashboardDomain(req.body.domain, auditSource(req), function (error, taskId) {
if (error && error.reason === CloudronError.BAD_FIELD) return next(new HttpError(404, error.message));
if (error && error.reason === CloudronError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, { taskId }));