From d60401a18122dd0d2f883fabd4ad7d9d94e1432b Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Thu, 9 Jan 2025 16:01:44 +0100 Subject: [PATCH] added curl error printing to check_version --- src/core/lib/utils/misc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/lib/utils/misc.c b/src/core/lib/utils/misc.c index 9864d4b..e9aca75 100644 --- a/src/core/lib/utils/misc.c +++ b/src/core/lib/utils/misc.c @@ -91,7 +91,14 @@ enum WHY2_EXIT_CODES why2_check_version(void) curl_easy_setopt(curl, CURLOPT_TIMEOUT, WHY2_CURL_TIMEOUT); //DOWNLOAD versions.json - curl_easy_perform(curl); + CURLcode curl_res = curl_easy_perform(curl); + if (curl_res != CURLE_OK && !why2_get_flags().no_output) //ERR + { + fprintf(stderr, "%sDownloading version failed!\n(%s)\n\nExiting...\n", WHY2_CLEAR_SCREEN, curl_easy_strerror(curl_res)); + + why2_clean_memory("core_version_check"); + return WHY2_DOWNLOAD_FAILED; + } //CLEANUP curl_easy_cleanup(curl);