From d557008077022a164d98e808474e9944d000b965 Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Tue, 8 Jun 2021 20:33:07 +1000 Subject: [PATCH] UI: Handle HTTP errors for fetching remote files --- UI/remote-text.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/UI/remote-text.cpp b/UI/remote-text.cpp index 074ed75c01ef8a..6d9fe2e9199aad 100644 --- a/UI/remote-text.cpp +++ b/UI/remote-text.cpp @@ -157,6 +157,7 @@ bool GetRemoteFile(const char *url, std::string &str, std::string &error, curl_easy_setopt(curl.get(), CURLOPT_ACCEPT_ENCODING, ""); curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, header); curl_easy_setopt(curl.get(), CURLOPT_ERRORBUFFER, error_in); + curl_easy_setopt(curl.get(), CURLOPT_FAILONERROR, 1L); curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, string_write); curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &str);