mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Show url for http error messages
This commit is contained in:
parent
2fc7fa88a7
commit
671d3ed056
@ -239,9 +239,9 @@ std::string API::getResponse(const std::string& url)
|
|||||||
long int response_code = 0;
|
long int response_code = 0;
|
||||||
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
||||||
if (result == CURLE_OK)
|
if (result == CURLE_OK)
|
||||||
this->setError("HTTP ERROR: " + std::to_string(response_code));
|
this->setError("HTTP ERROR: " + std::to_string(response_code) + " (" + url + ")");
|
||||||
else
|
else
|
||||||
this->setError("HTTP ERROR: failed to get error code: " + static_cast<std::string>(curl_easy_strerror(result)));
|
this->setError("HTTP ERROR: failed to get error code: " + static_cast<std::string>(curl_easy_strerror(result)) + " (" + url + ")");
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_FAILONERROR, false);
|
curl_easy_setopt(curlhandle, CURLOPT_FAILONERROR, false);
|
||||||
|
@ -1625,9 +1625,9 @@ int Downloader::downloadCovers(const std::string& gamename, const std::string& d
|
|||||||
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
||||||
std::cout << "HTTP ERROR: ";
|
std::cout << "HTTP ERROR: ";
|
||||||
if (result == CURLE_OK)
|
if (result == CURLE_OK)
|
||||||
std::cout << response_code << std::endl;
|
std::cout << response_code << " (" << cover_url << ")" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << "failed to get error code: " << curl_easy_strerror(result) << std::endl;
|
std::cout << "failed to get error code: " << curl_easy_strerror(result) << " (" << cover_url << ")" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
coverNode = gameNode->IterateChildren(coverNode);
|
coverNode = gameNode->IterateChildren(coverNode);
|
||||||
@ -1683,9 +1683,9 @@ std::string Downloader::getResponse(const std::string& url)
|
|||||||
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
||||||
std::cout << "HTTP ERROR: ";
|
std::cout << "HTTP ERROR: ";
|
||||||
if (result == CURLE_OK)
|
if (result == CURLE_OK)
|
||||||
std::cout << response_code << std::endl;
|
std::cout << response_code << " (" << url << ")" << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << "failed to get error code: " << curl_easy_strerror(result) << std::endl;
|
std::cout << "failed to get error code: " << curl_easy_strerror(result) << " (" << url << ")" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user