Skip to content

Commit 70c93d5

Browse files
Include more details when downloading release fails.
1 parent f476aa4 commit 70c93d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

script/ci/download.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ async function download() {
1313
const [, user, repo] = url.match(/\/([a-z0-9_.-]+)\/([a-z0-9_.-]+)\.git$/i)
1414

1515
const res = await fetch(`https://api.github.com/repos/${user}/${repo}/releases/tags/v${version}`)
16+
1617
if (!res.ok) {
17-
throw new Error(`Github release v${version} not found (${res.status})`)
18+
if (res.status == 404) {
19+
throw new Error(`Github release v${version} not found (${res.status})`)
20+
} else {
21+
const body = await res.text()
22+
throw new Error(`Github release v${version} not accessible (${res.status}): ${body}`)
23+
}
1824
}
1925

2026
const {assets} = await res.json()

0 commit comments

Comments
 (0)