Typo in error handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user