Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update wordings
  • Loading branch information
Ivan Zosimov
Ivan Zosimov committed Sep 20, 2023
commit 3fd8616c89efe671a98e9956988bf86d242f5b81
3 changes: 1 addition & 2 deletions __tests__/distributors/dragonwell-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('getAvailableVersions', () => {
await expect(
distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow(
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}".`
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".`
);
}
);
Expand All @@ -218,7 +218,6 @@ describe('getAvailableVersions', () => {
checkLatest: false
});
mockPlatform(distribution, platform);

await expect(
distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow('Dragonwell provides only the `jdk` package type');
Expand Down
20 changes: 10 additions & 10 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102656,7 +102656,7 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
findPackageForDownload(version) {
return __awaiter(this, void 0, void 0, function* () {
if (!this.stable) {
throw new Error('Early access versions are not supported');
throw new Error('Early access versions are not supported by Dragonwell');
}
if (this.packageType !== 'jdk') {
throw new Error('Dragonwell provides only the `jdk` package type');
Expand All @@ -102673,7 +102673,7 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
};
});
if (!matchedVersions.length) {
throw new Error(`Couldn't find any satisfied version for the specified java-version: "${version}".`);
throw new Error(`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".`);
}
const resolvedVersion = matchedVersions[0];
return resolvedVersion;
Expand All @@ -102688,9 +102688,9 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
fetchedDragonwellJson = yield this.fetchJsonFromBackupUrl();
}
if (!fetchedDragonwellJson) {
throw new Error(`Couldn't fetch dragonwell versions information from both primary and backup urls`);
throw new Error(`Couldn't fetch Dragonwell versions information from both primary and backup urls`);
}
core.debug('Successfully fetched information about available dragonwell versions');
core.debug('Successfully fetched information about available Dragonwell versions');
const availableVersions = this.parseVersions(platform, arch, fetchedDragonwellJson);
if (core.isDebug()) {
core.startGroup('Print information about available versions');
Expand Down Expand Up @@ -102780,12 +102780,12 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
return __awaiter(this, void 0, void 0, function* () {
const primaryUrl = 'https://dragonwell-jdk.io/map_with_checksum.json';
try {
core.debug(`Trying to fetch available versions info from the primary url: ${primaryUrl}`);
core.debug(`Trying to fetch available Dragonwell versions info from the primary url: ${primaryUrl}`);
const fetchedDragonwellJson = (yield this.http.getJson(primaryUrl)).result;
return fetchedDragonwellJson;
}
catch (err) {
core.debug(`Fetching from the primary link: ${primaryUrl} ended up with the error: ${err.message}`);
core.debug(`Fetching Dragonwell versions info from the primary link: ${primaryUrl} ended up with the error: ${err.message}`);
return null;
}
});
Expand All @@ -102799,12 +102799,12 @@ class DragonwellDistribution extends base_installer_1.JavaBase {
const backupUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
const headers = util_1.getGitHubHttpHeaders();
try {
core.debug(`Trying to fetch available versions info from the backup url: ${backupUrl}`);
const fetchedDragonwellVersions = (yield this.http.getJson(backupUrl, headers)).result;
return fetchedDragonwellVersions;
core.debug(`Trying to fetch available Dragonwell versions info from the backup url: ${backupUrl}`);
const fetchedDragonwellJson = (yield this.http.getJson(backupUrl, headers)).result;
return fetchedDragonwellJson;
}
catch (err) {
core.debug(`Fetching from the backup url: ${backupUrl} ended up with the error: ${err.message}`);
core.debug(`Fetching Dragonwell versions info from the backup url: ${backupUrl} ended up with the error: ${err.message}`);
return null;
}
});
Expand Down
20 changes: 10 additions & 10 deletions src/distributions/dragonwell/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DragonwellDistribution extends JavaBase {
version: string
): Promise<JavaDownloadRelease> {
if (!this.stable) {
throw new Error('Early access versions are not supported');
throw new Error('Early access versions are not supported by Dragonwell');
}

if (this.packageType !== 'jdk') {
Expand All @@ -50,7 +50,7 @@ export class DragonwellDistribution extends JavaBase {

if (!matchedVersions.length) {
throw new Error(
`Couldn't find any satisfied version for the specified java-version: "${version}".`
`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".`
);
}

Expand All @@ -70,12 +70,12 @@ export class DragonwellDistribution extends JavaBase {

if (!fetchedDragonwellJson) {
throw new Error(
`Couldn't fetch dragonwell versions information from both primary and backup urls`
`Couldn't fetch Dragonwell versions information from both primary and backup urls`
);
}

core.debug(
'Successfully fetched information about available dragonwell versions'
'Successfully fetched information about available Dragonwell versions'
);

const availableVersions = this.parseVersions(
Expand Down Expand Up @@ -204,15 +204,15 @@ export class DragonwellDistribution extends JavaBase {
const primaryUrl = 'https://dragonwell-jdk.io/map_with_checksum.json';
try {
core.debug(
`Trying to fetch available versions info from the primary url: ${primaryUrl}`
`Trying to fetch available Dragonwell versions info from the primary url: ${primaryUrl}`
);
const fetchedDragonwellJson = (
await this.http.getJson<IDragonwellAllVersions>(primaryUrl)
).result;
return fetchedDragonwellJson;
} catch (err) {
core.debug(
`Fetching from the primary link: ${primaryUrl} ended up with the error: ${err.message}`
`Fetching Dragonwell versions info from the primary link: ${primaryUrl} ended up with the error: ${err.message}`
);
return null;
}
Expand All @@ -230,15 +230,15 @@ export class DragonwellDistribution extends JavaBase {

try {
core.debug(
`Trying to fetch available versions info from the backup url: ${backupUrl}`
`Trying to fetch available Dragonwell versions info from the backup url: ${backupUrl}`
);
const fetchedDragonwellVersions = (
const fetchedDragonwellJson = (
await this.http.getJson<IDragonwellAllVersions>(backupUrl, headers)
).result;
return fetchedDragonwellVersions;
return fetchedDragonwellJson;
} catch (err) {
core.debug(
`Fetching from the backup url: ${backupUrl} ended up with the error: ${err.message}`
`Fetching Dragonwell versions info from the backup url: ${backupUrl} ended up with the error: ${err.message}`
);
return null;
}
Expand Down