Fix installation states
App operations can only be done in 'installed' or 'error' state. If some other operation is in progress, you have to cancel it first. This guarantees that the old app command got killed.
This commit is contained in:
@@ -276,6 +276,7 @@ function uninstallApp(req, res, next) {
|
||||
|
||||
apps.uninstall(req.params.id, auditSource.fromRequest(req), function (error, result) {
|
||||
if (error && error.reason === AppsError.EXTERNAL_ERROR) return next(new HttpError(424, error));
|
||||
if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(409, error.message));
|
||||
if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app'));
|
||||
if (error) return next(new HttpError(500, error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user