diff --git a/src/routes/apps.js b/src/routes/apps.js index 8c4cc3f4e..6800c8cd9 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -144,6 +144,8 @@ function configureApp(req, res, next) { apps.configure(req.params.id, data.location, data.portBindings, data.accessRestriction, function (error) { if (error && error.reason === AppsError.ALREADY_EXISTS) return next(new HttpError(409, error.message)); + if (error && error.reason === AppsError.PORT_RESERVED) return next(new HttpError(409, 'Port ' + error.message + ' is reserved.')); + if (error && error.reason === AppsError.PORT_CONFLICT) return next(new HttpError(409, 'Port ' + error.message + ' is already in use.')); if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app')); if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(409, error.message)); if (error && error.reason === AppsError.BAD_FIELD) return next(new HttpError(400, error.message));