Hello i have this issue.
try{
// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile()
->build();
// Construct an API session configured from a properties file and the OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();
$result = $this->EstimateKeywordTraffic(new AdWordsServices(), $session);
}
catch (ApiException $apiException) {
print_r($apiException);
} below my error:
Fatal error: Uncaught Google\AdsApi\AdWords\v201802\cm\ApiException:
[RateExceededError <rateName=RATE_LIMIT, rateKey=null,
rateScope=ACCOUNT, retryAfterSeconds=30>] in
/home/refleadfem/www/france/wp-content/plugins/adwords-plugin/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:39 Stack trace: #0 /home/refleadfem/www/france/wp-content/plugins/adwords-plugin/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(39): ReflectionClass->newInstanceArgs(Array) #1 /home/refleadfem/www/france/wp-content/plugins/adwords-plugin/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(165): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', Array) #2 /home/refleadfem/www/france/wp-content/plugins/adwords-plugin/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(130): Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault)) #3 /home/refleadfem/ in /home/refleadfem/www/france/wp-content/plugins/adwords-plugin/library/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php on line 39
i wrote use Google\AdsApi\AdWords\v201708\cm\ApiException;
but it does not work.
how to catch this execption thank you for helping me.
my goal is to slow down calls as soon as I catch the exception