update: throw error when update failed

This commit is contained in:
Girish Ramakrishnan
2026-02-26 11:09:42 +01:00
parent b6b0969879
commit 04758587b4

View File

@@ -176,7 +176,10 @@ async function updateBox(boxUpdateInfo, options, progressCallback) {
debug(`Updating box with ${boxUpdateInfo.sourceTarballUrl}`);
progressCallback({ percent: 70, message: 'Installing update...' });
const [error] = await safe(shell.sudo([ UPDATE_CMD, packageInfo.file, process.stdout.logFile ], {})); // run installer.sh from new box code as a separate service
if (error) await locks.release(locks.TYPE_BOX_UPDATE);
if (error) {
await locks.release(locks.TYPE_BOX_UPDATE);
throw new BoxError(BoxError.EXTERNAL_ERROR, 'Update failed. Check logs for more information.');
}
// Do not add any code here. The installer script will stop the box code any instant
}