mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Print more verbose error message in Downloader::getResponse
This commit is contained in:
parent
018a056e73
commit
e491c06780
@ -1401,7 +1401,19 @@ std::string Downloader::getResponse(const std::string& url)
|
||||
memory.str(std::string());
|
||||
|
||||
if (result != CURLE_OK)
|
||||
{
|
||||
std::cout << curl_easy_strerror(result) << std::endl;
|
||||
if (result == CURLE_HTTP_RETURNED_ERROR)
|
||||
{
|
||||
long int response_code = 0;
|
||||
result = curl_easy_getinfo(curlhandle, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
std::cout << "HTTP ERROR: ";
|
||||
if (result == CURLE_OK)
|
||||
std::cout << response_code << std::endl;
|
||||
else
|
||||
std::cout << "failed to get error code: " << curl_easy_strerror(result) << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user