From 57fa45759671c8ed6367b5baf63cd7d3e6b97db0 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 3 Sep 2019 15:55:57 -0700 Subject: [PATCH] Typo in error handling --- src/apps.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps.js b/src/apps.js index 071d7fd81..4df7e2b44 100644 --- a/src/apps.js +++ b/src/apps.js @@ -644,11 +644,11 @@ function scheduleTask(appId, args, values, callback) { appTaskManager.scheduleTask(appId, taskId, function (error) { debug(`scheduleTask: task ${taskId} of $${appId} completed`); - if (error && (error.crashed || error.stopped)) { + if (error && (error.code === tasks.ECRASHED || error.code === tasks.ESTOPPED)) { // if task crashed, update the error debug(`Apptask crashed/stopped: ${error.message}`); const code = error.crashed ? exports.ETASK_CRASHED : exports.ETASK_STOPPED; appdb.update(appId, { installationState: exports.ISTATE_ERROR, error: { code: code, message: error.message }, taskId: null }, NOOP_CALLBACK); - } else if (values.installationState !== exports.ISTATE_PENDING_UNINSTALL) { + } else if (values.installationState !== exports.ISTATE_PENDING_UNINSTALL) { // clear out taskId since it's done appdb.update(appId, { taskId: null }, NOOP_CALLBACK); } });