handle BAD_FIELD

This commit is contained in:
Girish Ramakrishnan
2016-07-04 23:32:27 -05:00
parent 70034602c7
commit eaeaf92c1a

View File

@@ -133,6 +133,7 @@ function migrate(req, res, next) {
cloudron.migrate(req.body, function (error) { // pass req.body because 'domain' can have arbitrary options
if (error && error.reason === CloudronError.BAD_STATE) return next(new HttpError(409, error.message));
if (error && error.reason === CloudronError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, {}));