diff --git a/__tests__/distributors/adopt-installer.test.ts b/__tests__/distributors/adopt-installer.test.ts index d24940ff..ff477be0 100644 --- a/__tests__/distributors/adopt-installer.test.ts +++ b/__tests__/distributors/adopt-installer.test.ts @@ -268,7 +268,7 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData as any; await expect( distribution['findPackageForDownload']('9.0.8') - ).rejects.toThrow(/Could not find satisfied version for SemVer */); + ).rejects.toThrow(/No matching version found for SemVer */); }); it('version is not found', async () => { @@ -283,7 +283,7 @@ describe('findPackageForDownload', () => { ); distribution['getAvailableVersions'] = async () => manifestData as any; await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); @@ -299,7 +299,7 @@ describe('findPackageForDownload', () => { ); distribution['getAvailableVersions'] = async () => []; await expect(distribution['findPackageForDownload']('11')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); }); diff --git a/__tests__/distributors/base-installer.test.ts b/__tests__/distributors/base-installer.test.ts index 3905c711..2a0b13ab 100644 --- a/__tests__/distributors/base-installer.test.ts +++ b/__tests__/distributors/base-installer.test.ts @@ -538,7 +538,7 @@ describe('setupJava', () => { ])('should throw an error for version not found for %s', async input => { mockJavaBase = new EmptyJavaBase(input); await expect(mockJavaBase.setupJava()).rejects.toThrow( - `Could not find satisfied version for SemVer '${input.version}'` + `No matching version found for SemVer '${input.version}'` ); expect(spyTcFindAllVersions).toHaveBeenCalled(); expect(spyCoreAddPath).not.toHaveBeenCalled(); @@ -584,7 +584,7 @@ describe('createVersionNotFoundError', () => { const error = (mockJavaBase as any).createVersionNotFoundError('17.0.5'); expect(error.message).toContain( - "Could not find satisfied version for SemVer '17.0.5'" + "No matching version found for SemVer '17.0.5'" ); expect(error.message).toContain('Distribution: Empty'); expect(error.message).toContain('Package type: jdk'); @@ -606,7 +606,7 @@ describe('createVersionNotFoundError', () => { ); expect(error.message).toContain( - "Could not find satisfied version for SemVer '17.0.5'" + "No matching version found for SemVer '17.0.5'" ); expect(error.message).toContain('Distribution: Empty'); expect(error.message).toContain('Package type: jdk'); @@ -653,7 +653,7 @@ describe('createVersionNotFoundError', () => { ); expect(error.message).toContain( - "Could not find satisfied version for SemVer '17.0.5'" + "No matching version found for SemVer '17.0.5'" ); expect(error.message).toContain('Distribution: Empty'); expect(error.message).toContain('Package type: jdk'); diff --git a/__tests__/distributors/corretto-installer.test.ts b/__tests__/distributors/corretto-installer.test.ts index 4234f4e4..7832e971 100644 --- a/__tests__/distributors/corretto-installer.test.ts +++ b/__tests__/distributors/corretto-installer.test.ts @@ -203,7 +203,7 @@ describe('getAvailableVersions', () => { await expect( distribution['findPackageForDownload'](version) - ).rejects.toThrow("Could not find satisfied version for SemVer '4'"); + ).rejects.toThrow("No matching version found for SemVer '4'"); }); it.each([ diff --git a/__tests__/distributors/dragonwell-installer.test.ts b/__tests__/distributors/dragonwell-installer.test.ts index de6564ed..a10f75a9 100644 --- a/__tests__/distributors/dragonwell-installer.test.ts +++ b/__tests__/distributors/dragonwell-installer.test.ts @@ -238,7 +238,7 @@ describe('getAvailableVersions', () => { await expect( distribution['findPackageForDownload'](jdkVersion) ).rejects.toThrow( - `Could not find satisfied version for SemVer '${jdkVersion}'` + `No matching version found for SemVer '${jdkVersion}'` ); } ); diff --git a/__tests__/distributors/graalvm-installer.test.ts b/__tests__/distributors/graalvm-installer.test.ts index 1ba002e6..6602ea05 100644 --- a/__tests__/distributors/graalvm-installer.test.ts +++ b/__tests__/distributors/graalvm-installer.test.ts @@ -356,9 +356,7 @@ describe('GraalVMDistribution', () => { // Verify the error is thrown with the expected message await expect( (distribution as any).findPackageForDownload('17.0.99') - ).rejects.toThrow( - "Could not find satisfied version for SemVer '17.0.99'" - ); + ).rejects.toThrow("No matching version found for SemVer '17.0.99'"); // Verify the hint about checking the base URL is included await expect( @@ -508,7 +506,7 @@ describe('GraalVMDistribution', () => { await expect( (distribution as any).findPackageForDownload('23') ).rejects.toThrow( - "No EA build is marked as 'latest' for version range '23-ea'. Available EA versions: 23-ea-20240716." + "No EA build is marked as latest for version '23-ea'. Available EA versions: ['23-ea-20240716']." ); // Verify error logging - removed as we now use the helper method which doesn't call core.error @@ -719,7 +717,7 @@ describe('GraalVMDistribution', () => { await expect( (distribution as any).findEABuildDownloadUrl('23-ea') ).rejects.toThrow( - "No EA build is marked as 'latest' for version range '23-ea'. Available EA versions: 23-ea-20240716, 23-ea-20240709." + "No EA build is marked as latest for version '23-ea'. Available EA versions: ['23-ea-20240716', '23-ea-20240709']." ); // Verify error logging - removed as we now use the helper method which doesn't call core.error diff --git a/__tests__/distributors/jetbrains-installer.test.ts b/__tests__/distributors/jetbrains-installer.test.ts index e75a76db..bf1dc15d 100644 --- a/__tests__/distributors/jetbrains-installer.test.ts +++ b/__tests__/distributors/jetbrains-installer.test.ts @@ -104,7 +104,7 @@ describe('findPackageForDownload', () => { }); distribution['getAvailableVersions'] = async () => manifestData as any; await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); @@ -117,7 +117,7 @@ describe('findPackageForDownload', () => { }); distribution['getAvailableVersions'] = async () => []; await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); }); diff --git a/__tests__/distributors/liberica-installer.test.ts b/__tests__/distributors/liberica-installer.test.ts index dbf7f43d..171bab16 100644 --- a/__tests__/distributors/liberica-installer.test.ts +++ b/__tests__/distributors/liberica-installer.test.ts @@ -215,7 +215,7 @@ describe('findPackageForDownload', () => { it('should throw an error', async () => { await expect(distribution['findPackageForDownload']('17')).rejects.toThrow( - /Could not find satisfied version for SemVer/ + /No matching version found for SemVer/ ); }); }); diff --git a/__tests__/distributors/liberica-linux-installer.test.ts b/__tests__/distributors/liberica-linux-installer.test.ts index 74f014b3..f6d20dd2 100644 --- a/__tests__/distributors/liberica-linux-installer.test.ts +++ b/__tests__/distributors/liberica-linux-installer.test.ts @@ -215,7 +215,7 @@ describe('findPackageForDownload', () => { it('should throw an error', async () => { await expect(distribution['findPackageForDownload']('18')).rejects.toThrow( - /Could not find satisfied version for SemVer/ + /No matching version found for SemVer/ ); }); }); diff --git a/__tests__/distributors/liberica-windows-installer.test.ts b/__tests__/distributors/liberica-windows-installer.test.ts index 0d6c12f4..da89ee7a 100644 --- a/__tests__/distributors/liberica-windows-installer.test.ts +++ b/__tests__/distributors/liberica-windows-installer.test.ts @@ -214,7 +214,7 @@ describe('findPackageForDownload', () => { it('should throw an error', async () => { await expect(distribution['findPackageForDownload']('18')).rejects.toThrow( - /Could not find satisfied version for SemVer/ + /No matching version found for SemVer/ ); }); }); diff --git a/__tests__/distributors/microsoft-installer.test.ts b/__tests__/distributors/microsoft-installer.test.ts index bac9d425..a971dc7f 100644 --- a/__tests__/distributors/microsoft-installer.test.ts +++ b/__tests__/distributors/microsoft-installer.test.ts @@ -179,7 +179,7 @@ describe('findPackageForDownload', () => { it('should throw an error', async () => { await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); }); diff --git a/__tests__/distributors/sapmachine-installer.test.ts b/__tests__/distributors/sapmachine-installer.test.ts index e2f19746..f49189a7 100644 --- a/__tests__/distributors/sapmachine-installer.test.ts +++ b/__tests__/distributors/sapmachine-installer.test.ts @@ -272,7 +272,7 @@ describe('getAvailableVersions', () => { await expect( distribution['findPackageForDownload'](normalizedVersion) ).rejects.toThrow( - `Could not find satisfied version for SemVer '${normalizedVersion}'` + `No matching version found for SemVer '${normalizedVersion}'` ); } ); diff --git a/__tests__/distributors/semeru-installer.test.ts b/__tests__/distributors/semeru-installer.test.ts index 61e618c2..1c26c79a 100644 --- a/__tests__/distributors/semeru-installer.test.ts +++ b/__tests__/distributors/semeru-installer.test.ts @@ -157,7 +157,7 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData as any; await expect( distribution['findPackageForDownload']('9.0.8') - ).rejects.toThrow(/Could not find satisfied version for SemVer */); + ).rejects.toThrow(/No matching version found for SemVer */); }); it('version is not found', async () => { @@ -169,7 +169,7 @@ describe('findPackageForDownload', () => { }); distribution['getAvailableVersions'] = async () => manifestData as any; await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); @@ -182,7 +182,7 @@ describe('findPackageForDownload', () => { }); distribution['getAvailableVersions'] = async () => []; await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); diff --git a/__tests__/distributors/temurin-installer.test.ts b/__tests__/distributors/temurin-installer.test.ts index 5810c881..0c6ef3f5 100644 --- a/__tests__/distributors/temurin-installer.test.ts +++ b/__tests__/distributors/temurin-installer.test.ts @@ -218,7 +218,7 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData as any; await expect( distribution['findPackageForDownload']('9.0.8') - ).rejects.toThrow(/Could not find satisfied version for SemVer */); + ).rejects.toThrow(/No matching version found for SemVer */); }); it('version is not found', async () => { @@ -233,7 +233,7 @@ describe('findPackageForDownload', () => { ); distribution['getAvailableVersions'] = async () => manifestData as any; await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); @@ -249,7 +249,7 @@ describe('findPackageForDownload', () => { ); distribution['getAvailableVersions'] = async () => []; await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( - /Could not find satisfied version for SemVer */ + /No matching version found for SemVer */ ); }); }); diff --git a/__tests__/distributors/zulu-installer.test.ts b/__tests__/distributors/zulu-installer.test.ts index 1372d0e4..0a46983b 100644 --- a/__tests__/distributors/zulu-installer.test.ts +++ b/__tests__/distributors/zulu-installer.test.ts @@ -231,6 +231,6 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData; await expect( distribution['findPackageForDownload'](distribution['version']) - ).rejects.toThrow(/Could not find satisfied version for SemVer/); + ).rejects.toThrow(/No matching version found for SemVer/); }); }); diff --git a/__tests__/distributors/zulu-linux-installer.test.ts b/__tests__/distributors/zulu-linux-installer.test.ts index a37da36e..b3ca6fa1 100644 --- a/__tests__/distributors/zulu-linux-installer.test.ts +++ b/__tests__/distributors/zulu-linux-installer.test.ts @@ -234,6 +234,6 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData; await expect( distribution['findPackageForDownload'](distribution['version']) - ).rejects.toThrow(/Could not find satisfied version for SemVer/); + ).rejects.toThrow(/No matching version found for SemVer/); }); }); diff --git a/__tests__/distributors/zulu-windows-installer.test.ts b/__tests__/distributors/zulu-windows-installer.test.ts index c70c1a78..37435e8d 100644 --- a/__tests__/distributors/zulu-windows-installer.test.ts +++ b/__tests__/distributors/zulu-windows-installer.test.ts @@ -232,6 +232,6 @@ describe('findPackageForDownload', () => { distribution['getAvailableVersions'] = async () => manifestData; await expect( distribution['findPackageForDownload'](distribution['version']) - ).rejects.toThrow(/Could not find satisfied version for SemVer/); + ).rejects.toThrow(/No matching version found for SemVer/); }); }); diff --git a/dist/setup/index.js b/dist/setup/index.js index d87d859a..77932108 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -112571,7 +112571,7 @@ class JavaBase { } createVersionNotFoundError(versionOrRange, availableVersions, additionalContext) { const parts = [ - `Could not find satisfied version for SemVer '${versionOrRange}'.`, + `No matching version found for SemVer '${versionOrRange}'.`, `Distribution: ${this.distribution}`, `Package type: ${this.packageType}`, `Architecture: ${this.architecture}` @@ -113238,9 +113238,9 @@ class GraalVMDistribution extends base_installer_1.JavaBase { const latestVersion = versions.find(v => v.latest); if (!latestVersion) { const availableVersions = versions.map(v => v.version); - let message = `No EA build is marked as 'latest' for version range '${javaEaVersion}'.`; + let message = `No EA build is marked as latest for version '${javaEaVersion}'.`; if (availableVersions.length > 0) { - message += ` Available EA versions: ${availableVersions.join(', ')}.`; + message += ` Available EA versions: [${availableVersions.map(v => `'${v}'`).join(', ')}].`; } throw new Error(message); } diff --git a/src/distributions/base-installer.ts b/src/distributions/base-installer.ts index c3eb263a..10e37d99 100644 --- a/src/distributions/base-installer.ts +++ b/src/distributions/base-installer.ts @@ -265,7 +265,7 @@ export abstract class JavaBase { additionalContext?: string ): Error { const parts = [ - `Could not find satisfied version for SemVer '${versionOrRange}'.`, + `No matching version found for SemVer '${versionOrRange}'.`, `Distribution: ${this.distribution}`, `Package type: ${this.packageType}`, `Architecture: ${this.architecture}` diff --git a/src/distributions/graalvm/installer.ts b/src/distributions/graalvm/installer.ts index a92f901f..f97f6c4a 100644 --- a/src/distributions/graalvm/installer.ts +++ b/src/distributions/graalvm/installer.ts @@ -182,9 +182,9 @@ export class GraalVMDistribution extends JavaBase { const latestVersion = versions.find(v => v.latest); if (!latestVersion) { const availableVersions = versions.map(v => v.version); - let message = `No EA build is marked as 'latest' for version range '${javaEaVersion}'.`; + let message = `No EA build is marked as latest for version '${javaEaVersion}'.`; if (availableVersions.length > 0) { - message += ` Available EA versions: ${availableVersions.join(', ')}.`; + message += ` Available EA versions: [${availableVersions.map(v => `'${v}'`).join(', ')}].`; } throw new Error(message); }