Skip to content

Commit 8d983ae

Browse files
committed
fix: improve error handling and logging in http_download_curl function of installation script
1 parent de0a2a8 commit 8d983ae

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

install.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,16 @@ http_download_curl() {
417417
source_url=$2
418418
header=$3
419419
if [ -z "$header" ]; then
420-
log_debug "Executing: curl -sfL -o \"$local_file\" \"$source_url\""
421-
curl -sfL -o "$local_file" "$source_url"
420+
log_debug "Executing: curl -sL -o \"$local_file\" \"$source_url\""
421+
code=$(curl -sL -o "$local_file" "$source_url")
422422
else
423-
log_debug "Executing: curl -sfL -H \"$header\" -o \"$local_file\" \"$source_url\""
424-
curl -sfL -H "$header" -o "$local_file" "$source_url"
423+
log_debug "Executing: curl -sL -H \"$header\" -o \"$local_file\" \"$source_url\""
424+
code=$(curl -sL -H "$header" -o "$local_file" "$source_url")
425425
fi
426+
log_debug "http_download_curl received HTTP status $code, return code $?"
426427
if [ $? -ne 0 ]; then
427428
log_err "Failed to download from $source_url"
428-
return 1
429+
return 1 # Return 1 for failure
429430
fi
430431
return 0
431432
}

0 commit comments

Comments
 (0)