mirror of
https://github.com/actions/setup-java.git
synced 2026-04-19 17:18:40 +08:00
Refactor error handling and improve test logging for installers (#989)
* Refactor error handling for version not found cases across multiple installers * Mock core.error in tests to suppress error logs * fix(graalvm): improve error messages for EA version not found scenarios * refactor(tests): update error messages for version not found scenarios * fix(graalvm): enhance error messages for version not found scenarios * fix(graalvm): improve error messages for version not found scenarios with updated download URL * fix(graalvm): improve error handling for EA version not found scenarios with clearer messages
This commit is contained in:
@@ -79,14 +79,16 @@ export class SemeruDistribution extends JavaBase {
|
||||
const resolvedFullVersion =
|
||||
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
||||
if (!resolvedFullVersion) {
|
||||
const availableOptions = availableVersionsWithBinaries
|
||||
.map(item => item.version)
|
||||
.join(', ');
|
||||
const availableOptionsMessage = availableOptions
|
||||
? `\nAvailable versions: ${availableOptions}`
|
||||
: '';
|
||||
throw new Error(
|
||||
`Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`
|
||||
const availableVersionStrings = availableVersionsWithBinaries.map(
|
||||
item => item.version
|
||||
);
|
||||
// Include platform context to help users understand OS-specific version availability
|
||||
// IBM Semeru builds are OS-specific, so platform info aids in troubleshooting
|
||||
const platformContext = `Platform: ${process.platform}`;
|
||||
throw this.createVersionNotFoundError(
|
||||
version,
|
||||
availableVersionStrings,
|
||||
platformContext
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user