continue on CURL errors

main
Simon Quigley 3 days ago
parent 3d459c1661
commit bb71c5cdf8

@ -272,21 +272,13 @@ std::optional<std::string> launchpad::api_get(const std::string endpoint, const
while (tries < 5) {
tries++;
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
std::cerr << "CURL GET error: " << curl_easy_strerror(res) << std::endl;
}
if (res != CURLE_OK) { continue; }
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
if (res != CURLE_OK) {
continue;
}
if (http_code >= 400) {
continue;
}
if (res != CURLE_OK || http_code >= 400) { continue; }
return readBuffer;
}
@ -358,21 +350,13 @@ std::optional<std::string> launchpad::api_post(
while (tries < 5) {
tries++;
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
std::cerr << "CURL POST error: " << curl_easy_strerror(res) << std::endl;
}
if (res != CURLE_OK) { continue; }
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
if (res != CURLE_OK) {
continue;
}
if (http_code >= 400) {
continue;
}
if (res != CURLE_OK || http_code >= 400) { continue; }
return readBuffer;
}

Loading…
Cancel
Save