From 49b34f3f12cf8d385f9ff45d362e8f77ad3992c4 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 13 Dec 2021 16:46:03 +0300 Subject: [PATCH 1/2] throw error if version is not stable --- dist/setup/index.js | 3 +++ src/distributions/microsoft/installer.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/dist/setup/index.js b/dist/setup/index.js index 855880b76..79a28c2d9 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -13886,6 +13886,9 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { if (this.architecture !== 'x64' && this.architecture !== 'aarch64') { throw new Error(`Unsupported architecture: ${this.architecture}`); } + if (!this.stable) { + throw new Error('Unstable versions are not supported'); + } const availableVersionsRaw = yield this.getAvailableVersions(); const opts = this.getPlatformOption(); const availableVersions = availableVersionsRaw.map(item => ({ diff --git a/src/distributions/microsoft/installer.ts b/src/distributions/microsoft/installer.ts index 79fffe5ee..9afb695e1 100644 --- a/src/distributions/microsoft/installer.ts +++ b/src/distributions/microsoft/installer.ts @@ -40,6 +40,11 @@ export class MicrosoftDistributions extends JavaBase { if (this.architecture !== 'x64' && this.architecture !== 'aarch64') { throw new Error(`Unsupported architecture: ${this.architecture}`); } + + if (!this.stable) { + throw new Error('Unstable versions are not supported'); + } + const availableVersionsRaw = await this.getAvailableVersions(); const opts = this.getPlatformOption(); From 4f4e2942863835285765ac9759d7f152c476f29f Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 14 Dec 2021 17:49:20 +0300 Subject: [PATCH 2/2] fix error message for ea version --- dist/setup/index.js | 2 +- src/distributions/microsoft/installer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 79a28c2d9..fd2ca8099 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -13887,7 +13887,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { throw new Error(`Unsupported architecture: ${this.architecture}`); } if (!this.stable) { - throw new Error('Unstable versions are not supported'); + throw new Error('Early access versions are not supported'); } const availableVersionsRaw = yield this.getAvailableVersions(); const opts = this.getPlatformOption(); diff --git a/src/distributions/microsoft/installer.ts b/src/distributions/microsoft/installer.ts index 9afb695e1..477cb62e3 100644 --- a/src/distributions/microsoft/installer.ts +++ b/src/distributions/microsoft/installer.ts @@ -42,7 +42,7 @@ export class MicrosoftDistributions extends JavaBase { } if (!this.stable) { - throw new Error('Unstable versions are not supported'); + throw new Error('Early access versions are not supported'); } const availableVersionsRaw = await this.getAvailableVersions();