Skip to content

Commit b628fe5

Browse files
committed
Avoid silently ignoring CDN errors
1 parent 404af6f commit b628fe5

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/dotnet/scripts/dotnet-helpers.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ DOTNET_RELEASES_INDEX_URL="https://builds.dotnet.microsoft.com/dotnet/release-me
1818
fetch_latest_version() {
1919
local runtime="$1"
2020
local version_field="latest-sdk"
21+
local releases_index=""
2122

2223
if [ -n "$runtime" ]; then
2324
version_field="latest-runtime"
2425
fi
2526

26-
wget -qO- "$DOTNET_RELEASES_INDEX_URL" \
27+
releases_index="$(wget -qO- "$DOTNET_RELEASES_INDEX_URL")" || return $?
28+
29+
printf '%s\n' "$releases_index" \
2730
| jq -er --arg version_field "$version_field" '
2831
.["releases-index"]
2932
| map(

test/dotnet/dotnet_helpers.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ DOTNET_RELEASES_INDEX_URL="https://builds.dotnet.microsoft.com/dotnet/release-me
1010
fetch_latest_version() {
1111
local runtime="$1"
1212
local version_field="latest-sdk"
13+
local releases_index=""
1314

1415
if [ -n "$runtime" ]; then
1516
version_field="latest-runtime"
1617
fi
1718

18-
wget -qO- "$DOTNET_RELEASES_INDEX_URL" \
19+
releases_index="$(wget -qO- "$DOTNET_RELEASES_INDEX_URL")" || return $?
20+
21+
printf '%s\n' "$releases_index" \
1922
| jq -er --arg version_field "$version_field" '
2023
.["releases-index"]
2124
| map(

0 commit comments

Comments
 (0)