diff --git a/__tests__/distributors/graalvm-installer.test.ts b/__tests__/distributors/graalvm-installer.test.ts index 6602ea05..134273c6 100644 --- a/__tests__/distributors/graalvm-installer.test.ts +++ b/__tests__/distributors/graalvm-installer.test.ts @@ -356,7 +356,9 @@ describe('GraalVMDistribution', () => { // Verify the error is thrown with the expected message await expect( (distribution as any).findPackageForDownload('17.0.99') - ).rejects.toThrow("No matching version found for SemVer '17.0.99'"); + ).rejects.toThrow( + "No matching GraalVM version found for SemVer '17.0.99'. Available versions can be found at https://download.oracle.com/graalvm/. Pick a version from the list." + ); // Verify the hint about checking the base URL is included await expect( diff --git a/dist/setup/index.js b/dist/setup/index.js index 77932108..dffa0517 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -113217,10 +113217,9 @@ class GraalVMDistribution extends base_installer_1.JavaBase { handleHttpResponse(response, range) { const statusCode = response.message.statusCode; if (statusCode === http_client_1.HttpCodes.NotFound) { - // Create the standard error with additional hint about checking the download URL - const error = this.createVersionNotFoundError(range); - error.message += `\nPlease check if this version is available at ${GRAALVM_DL_BASE}`; - throw error; + throw new Error(`No matching GraalVM version found for SemVer '${range}'.` + + ` Available versions can be found at ${GRAALVM_DL_BASE}/.` + + ` Pick a version from the list.`); } if (statusCode === http_client_1.HttpCodes.Unauthorized || statusCode === http_client_1.HttpCodes.Forbidden) { diff --git a/src/distributions/graalvm/installer.ts b/src/distributions/graalvm/installer.ts index f97f6c4a..1d645054 100644 --- a/src/distributions/graalvm/installer.ts +++ b/src/distributions/graalvm/installer.ts @@ -149,10 +149,11 @@ export class GraalVMDistribution extends JavaBase { const statusCode = response.message.statusCode; if (statusCode === HttpCodes.NotFound) { - // Create the standard error with additional hint about checking the download URL - const error = this.createVersionNotFoundError(range); - error.message += `\nPlease check if this version is available at ${GRAALVM_DL_BASE}`; - throw error; + throw new Error( + `No matching GraalVM version found for SemVer '${range}'.` + + ` Available versions can be found at ${GRAALVM_DL_BASE}/.` + + ` Pick a version from the list.` + ); } if (