From e12f5e41ff332b2c43d01f86640478f61d855b2e Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 6 Jan 2026 15:10:15 +0100 Subject: [PATCH] Better error for invalid update versions --- src/appstore.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/appstore.js b/src/appstore.js index 3ca8102c8..9ee0e72e9 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -207,9 +207,8 @@ async function getBoxUpdate(options) { const updateInfo = response.body; - if (!semver.valid(updateInfo.version) || semver.gt(constants.VERSION, updateInfo.version)) { - throw new BoxError(BoxError.EXTERNAL_ERROR, `Update version invalid or is a downgrade: ${response.status} ${response.text}`); - } + if (!semver.valid(updateInfo.version)) throw new BoxError(BoxError.EXTERNAL_ERROR, `Offered version ${updateInfo.version} is invalid`); + if (semver.gt(constants.VERSION, updateInfo.version)) throw new BoxError(BoxError.EXTERNAL_ERROR, `Offered version ${updateInfo.version} would be a downgrade`); // updateInfo: { version, changelog, sourceTarballUrl, sourceTarballSigUrl, boxVersionsUrl, boxVersionsSigUrl } if (!updateInfo.version || typeof updateInfo.version !== 'string') throw new BoxError(BoxError.EXTERNAL_ERROR, `Bad response (bad version): ${response.status} ${response.text}`);