From 04758587b4fda9eef99cf0c74623ef76da5a32df Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 26 Feb 2026 11:09:42 +0100 Subject: [PATCH] update: throw error when update failed --- src/updater.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/updater.js b/src/updater.js index cb286a4be..670434e39 100644 --- a/src/updater.js +++ b/src/updater.js @@ -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 }