fix: catch download errors

This commit is contained in:
Amin Yahyaabadi 2022-01-30 15:38:33 -08:00
parent c1478378fa
commit d3d6f6195e
4 changed files with 9 additions and 4 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -289,6 +289,7 @@ All the available tools:
--meson --meson
--conan --conan
--make --make
--task
--ccache --ccache
--cppcheck --cppcheck
--clangformat --clangformat

View File

@ -87,8 +87,12 @@ export async function setupBin(
await setupAptPack("xz-utils") await setupAptPack("xz-utils")
} }
const downloaded = await downloadTool(url) try {
await extractFunction?.(downloaded, setupDir) const downloaded = await downloadTool(url)
await extractFunction?.(downloaded, setupDir)
} catch (err) {
throw new Error(`Failed to download ${name} ${version} ${arch}: ${err}`)
}
} }
// Adding the bin dir to the path // Adding the bin dir to the path