Sfoglia il codice sorgente

UI: Handle HTTP errors for fetching remote files

Matt Gajownik 4 anni fa
parent
commit
cf9899bade
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      UI/remote-text.cpp

+ 1 - 0
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);