Return NOT_FOUND if app is missing in appstore

This commit is contained in:
Girish Ramakrishnan
2018-01-24 10:45:36 -08:00
parent 962ebc835d
commit efc6a5acd0
2 changed files with 2 additions and 1 deletions

View File

@@ -149,6 +149,7 @@ function installApp(req, res, next) {
debug('Installing app :%j', data);
apps.install(data, auditSource(req), function (error, app) {
if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, error.message));
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.'));