log the response code from Roblox API

This commit is contained in:
lightbulblighter 2022-06-11 03:40:48 -07:00
parent fc64a4002a
commit d6c3848f67
No known key found for this signature in database
GPG Key ID: 0B2452F9DE0E2D01
1 changed files with 6 additions and 1 deletions

View File

@ -113,11 +113,16 @@ void __fastcall Http__httpGetPostWinInet_hook(Http* _this, void*, bool isPost, i
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (result != CURLE_OK || response != 200) if (result != CURLE_OK)
{ {
throw std::runtime_error("Unexpected error occurred when fetching Roblox API: 0x0"); throw std::runtime_error("Unexpected error occurred when fetching Roblox API: 0x0");
} }
if (response != 200)
{
throw std::runtime_error("Unexpected error occurred when fetching Roblox API: Response code was " + std::to_string(response));
}
rapidjson::Document document; rapidjson::Document document;
document.Parse(data.c_str()); document.Parse(data.c_str());