update: throw error when update failed
This commit is contained in:
+4
-1
@@ -176,7 +176,10 @@ async function updateBox(boxUpdateInfo, options, progressCallback) {
|
|||||||
debug(`Updating box with ${boxUpdateInfo.sourceTarballUrl}`);
|
debug(`Updating box with ${boxUpdateInfo.sourceTarballUrl}`);
|
||||||
progressCallback({ percent: 70, message: 'Installing update...' });
|
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
|
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
|
// Do not add any code here. The installer script will stop the box code any instant
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user