On backup error, only set the task error

at some point, the backup ui can show this error
This commit is contained in:
Girish Ramakrishnan
2019-12-05 16:31:11 -08:00
parent a8b489624d
commit cea543cba5

View File

@@ -639,8 +639,8 @@ function backup(app, args, progressCallback, callback) {
], function seriesDone(error) {
if (error) {
debugApp(app, 'error backing up app: %s', error);
// return to installed state intentionally
return updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: error.toPlainObject ? error.toPlainObject() : error.message }, callback.bind(null, error));
// return to installed state intentionally. the error is stashed only in the task and not the app (the UI shows error state otherwise)
return updateApp(app, { installationState: apps.ISTATE_INSTALLED, error: null }, callback.bind(null, makeTaskError(error, app)));
}
callback(null);
});