Tell user to try --login if JSON parsing fails in Downloader::getGames

This commit is contained in:
Sude 2015-07-01 04:03:27 +03:00
parent 699c9f29a5
commit 84e8ab8dab

View File

@ -2105,6 +2105,14 @@ std::vector<gameItem> Downloader::getGames()
#endif #endif
std::cout << jsonparser->getFormatedErrorMessages(); std::cout << jsonparser->getFormatedErrorMessages();
delete jsonparser; delete jsonparser;
if (!response.empty())
{
if(response[0] != '{')
{
// Response was not JSON. Assume that cookies have expired.
std::cerr << "Response was not JSON. Cookies have most likely expired. Try --login first." << std::endl;
}
}
exit(1); exit(1);
} }
#ifdef DEBUG #ifdef DEBUG