Skip to content

httpclient_test: outside_ssl_json fails due to Google API "dailyLimitExceeded" response #1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garethsb opened this issue Feb 17, 2020 · 1 comment

Comments

@garethsb
Copy link
Contributor

...\cpprestsdk\Release\tests\functional\http\client\outside_tests.cpp(317): error: Failure in outside_ssl_json: CHECK_NOT_EQUAL(obj.find(L"pageInfo"), obj.end())
FAILED
...\cpprestsdk\Release\tests\functional\http\client\outside_tests.cpp(318): error: Failure in outside_ssl_json: CHECK_NOT_EQUAL(obj.find(L"items"), obj.end())
FAILED
...\cpprestsdk\Release\tests\functional\http\client\outside_tests.cpp(291): error: Failure in outside_ssl_json: Unhandled exception: not an array FAILED
Test case outside_tests:outside_ssl_json FAILED

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceeded",
    "message": "Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=368036497463",
    "extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=368036497463"
   }
  ],
  "code": 403,
  "message": "Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=368036497463"
 }
}

Follow up to #27.

@garethsb
Copy link
Contributor Author

To be honest, I'm not sure why this test case goes into the level of checking that it does. If we've opened a secure connection and retrieved some valid JSON, that's surely enough?

Can we just delete the continuation?

.then([=](json::value v) {
int count = 0;
auto& obj = v.as_object();
VERIFY_ARE_NOT_EQUAL(obj.find(U("pageInfo")), obj.end());
VERIFY_ARE_NOT_EQUAL(obj.find(U("items")), obj.end());
auto& items = obj[U("items")];
for (auto iter = items.as_array().cbegin(); iter != items.as_array().cend(); ++iter)
{
const auto& item = *iter;
auto iSnippet = item.as_object().find(U("snippet"));
if (iSnippet == item.as_object().end())
{
throw std::runtime_error("snippet key not found");
}
auto iTitle = iSnippet->second.as_object().find(U("title"));
if (iTitle == iSnippet->second.as_object().end())
{
throw std::runtime_error("title key not found");
}
auto name = iTitle->second.serialize();
count++;
}
VERIFY_ARE_EQUAL(3, count); // Update this accordingly, if the number of items changes
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant