feat: Improve error handling (#1936)

This commit is contained in:
Kroese
2026-07-21 21:53:21 +02:00
committed by GitHub
parent 958d25d095
commit 48150e7060
3 changed files with 37 additions and 10 deletions
+7 -2
View File
@@ -883,7 +883,10 @@ fallbackEnglish() {
# still locate the same image, but use English installation media.
LANGUAGE="en"
rm -f "$iso"
if ! rm -f -- "$iso"; then
error "Failed to remove ISO file \"$iso\" !"
return 1
fi
downloadImage "$iso" "$version" "$LANGUAGE"
}
@@ -1010,7 +1013,9 @@ downloadImage() {
done
if [[ "${lang,,}" != "en" && "${lang,,}" != "en-"* ]]; then
fallbackEnglish "$iso" "$version" "$lang" "$desc" && return 0
if fallbackEnglish "$iso" "$version" "$lang" "$desc"; then
return 0
fi
fi
return 1