From 1004c3428b39427fd9a92e3bc89c7dbcc0a76dec Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 16 Apr 2024 17:11:17 +0100 Subject: [PATCH] refactor: update handle_curl_error() based Mido --- quickget | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/quickget b/quickget index 84baa0b..592f8b4 100755 --- a/quickget +++ b/quickget @@ -3350,6 +3350,12 @@ handle_curl_error() { 7) echo "Failed to contact Microsoft servers! Is there an Internet connection or is the server down?" ;; + 8) + echo "Microsoft servers returned a malformed HTTP response!" + ;; + 22) + echo "Microsoft servers returned a failing HTTP status code!" + ;; 23) echo "Failed at writing Windows media to disk! Out of disk space or permission error? Exiting..." return "$fatal_error_action" @@ -3361,15 +3367,15 @@ handle_curl_error() { 36) echo "Failed to continue earlier download!" ;; - 22) - echo "Microsoft servers returned failing HTTP status code!" + 63) + echo "Microsoft servers returned an unexpectedly large response!" ;; # POSIX defines exit statuses 1-125 as usable by us # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02 $((error_code <= 125))) - # Must be some other server error (possibly with this specific request/file) - # This is when accounting for all possible errors in the curl manual assuming a correctly formed curl command and HTTP(S) request, using only the curl features we're using, and a sane build - echo "Server returned an error status!" + # Must be some other server or network error (possibly with this specific request/file) + # This is when accounting for all possible errors in the curl manual assuming a correctly formed curl command and an HTTP(S) request, using only the curl features we're using, and a sane build + echo "Miscellaneous server or network error!" ;; 126 | 127) echo "Curl command not found! Please install curl and try again. Exiting..."