Skip to content

Commit b4b0e08

Browse files
committed
feat: print the supported versions when throwing errors
1 parent 5c2a341 commit b4b0e08

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ignorePaths:
1111
- "**/node_modules/"
1212
words:
1313
- aarch
14+
- clangd
1415
- aminya
1516
- applellvm
1617
- bazel

dist/node12/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node12/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node16/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/llvm/llvm_url.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const VERSIONS: Set<string> = getVersions([
6666
"16.0.1",
6767
"16.0.2",
6868
"16.0.3",
69-
"16.0.4"
69+
"16.0.4",
7070
])
7171

7272
/** The LLVM versions that were never released for the Windows platform. */
@@ -96,7 +96,7 @@ const DARWIN_MISSING = new Set([
9696
"16.0.1",
9797
"16.0.2",
9898
"16.0.3",
99-
"16.0.4"
99+
"16.0.4",
100100
])
101101

102102
/**

src/utils/setup/version.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export async function getSpecificVersionAndUrl(
4949

5050
// if the given set doesn't include the version, throw an error
5151
if (!versions.has(version)) {
52-
throw new Error(`Unsupported target! (platform='${platform}', version='${version}')`)
52+
throw new Error(
53+
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
54+
versions
55+
)}`
56+
)
5357
}
5458

5559
const offlineUrls: string[] = []
@@ -68,8 +72,8 @@ export async function getSpecificVersionAndUrl(
6872
}
6973

7074
throw new Error(
71-
`Unsupported target! (platform='${platform}', version='${version}'). The offline urls tested:\n${offlineUrls.join(
72-
"\n"
75+
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
76+
versions
7377
)}`
7478
)
7579
}

0 commit comments

Comments
 (0)