diff --git a/src/apps.js b/src/apps.js index bd681edfa..e06db3874 100644 --- a/src/apps.js +++ b/src/apps.js @@ -381,7 +381,7 @@ function getDataDir(app, dataDir) { function removeInternalFields(app) { return _.pick(app, - 'id', 'appStoreId', 'installationState', 'errorMessage', 'runState', 'health', 'taskId', + 'id', 'appStoreId', 'installationState', 'error', 'runState', 'health', 'taskId', 'location', 'domain', 'fqdn', 'mailboxName', 'accessRestriction', 'manifest', 'portBindings', 'iconUrl', 'memoryLimit', 'sso', 'debugMode', 'robotsTxt', 'enableBackup', 'creationTime', 'updateTime', 'ts', 'tags', @@ -391,7 +391,7 @@ function removeInternalFields(app) { // non-admins can only see these function removeRestrictedFields(app) { return _.pick(app, - 'id', 'appStoreId', 'installationState', 'errorMessage', 'runState', 'health', 'taskId', + 'id', 'appStoreId', 'installationState', 'error', 'runState', 'health', 'taskId', 'location', 'domain', 'fqdn', 'manifest', 'portBindings', 'iconUrl', 'creationTime', 'ts', 'tags', 'label'); } @@ -587,7 +587,7 @@ function scheduleTask(appId, args, values, callback) { tasks.add(tasks.TASK_APP, [ appId, args ], function (error, taskId) { if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); - values.errorMessage = ''; + values.error = null; values.taskId = taskId; appdb.setTask(appId, values, function (error) { @@ -599,7 +599,7 @@ function scheduleTask(appId, args, values, callback) { debug(`scheduleTask: task ${taskId} of $${appId} completed`); if (error && (error.crashed || error.stopped)) { debug(`Apptask crashed/stopped: ${error.message}`); - appdb.update(appId, { installationState: appdb.ISTATE_ERROR, errorMessage: error.message, taskId: null }, NOOP_CALLBACK); + appdb.update(appId, { installationState: appdb.ISTATE_ERROR, error: { message: error.message }, taskId: null }, NOOP_CALLBACK); } else if (values.installationState !== appdb.ISTATE_PENDING_UNINSTALL) { appdb.update(appId, { taskId: null }, NOOP_CALLBACK); } diff --git a/src/routes/test/oauth2-test.js b/src/routes/test/oauth2-test.js index 959ba4ab1..44451d85b 100644 --- a/src/routes/test/oauth2-test.js +++ b/src/routes/test/oauth2-test.js @@ -1282,7 +1282,8 @@ describe('Password', function () { createdAt: (new Date()).toUTCString(), modifiedAt: (new Date()).toUTCString(), resetToken: hat(256), - displayName: '' + displayName: '', + source: '' }; // make csrf always succeed for testing