Strange behavvior of RateExceededError.RATE_EXCEEDED

62 views
Skip to first unread message

di...@easyleads.com

unread,
Jul 25, 2017, 6:11:29 AM7/25/17
to AdWords API Forum
Hi,

A week ago we migrated from v201609 to v201705 and since then our handler of RATE_EXCEEDED stopped working.

We followed the migrate guides of both v201702 and v201705 and didn't notice any remind of this change.

Our code that worked for a long time:
if(e instanceof ApiException){
for (ApiError error : ((ApiException)e).getErrors()) {
if (error instanceof RateExceededError) {
RateExceededError rateExceeded = (RateExceededError) error;
Thread.sleep(rateExceeded.getRetryAfterSeconds() * 1000);
}
}
}

Now it doesn't work because the relevant exception is an instance of DetailedReportDownloadResponseException and not ApiException
HTTP Response Code: 400, Type: RateExceededError.RATE_EXCEEDED 
at com.google.api.ads.adwords.lib.utils.v201705.DetailedReportDownloadResponseException$Builder.build(DetailedReportDownloadResponseException.java:35) 
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.handleResponse(AdHocReportDownloadHelperImpl.java:117) 
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelperImpl.downloadReport(AdHocReportDownloadHelperImpl.java:60) 
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at com.google.api.ads.common.lib.utils.AdsUtilityInvocationHandler.handleInvocation(AdsUtilityInvocationHandler.java:46) 
at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:84) 
at com.sun.proxy.$Proxy33.downloadReport(Unknown Source) 
at com.google.api.ads.adwords.lib.utils.AdHocReportDownloadHelper.downloadReport(AdHocReportDownloadHelper.java:46) 
at com.google.api.ads.adwords.lib.utils.v201705.ReportDownloader.downloadReport(ReportDownloader.java:73) 

What are we missing?

Thanks

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Jul 25, 2017, 3:39:45 PM7/25/17
to AdWords API Forum
Hi Dima, 

Could you please confirm the version of the Java client library that you upgraded from and your current library version? Could you also share the complete RateExceededError with the Elements of RateExceededError? If you happen to have the logs from before migration where the error was being handled that will be helpful too. 

Since this is specific to the Java client library, you can also post on the repository so that the library owner can take a look. 

Thanks,
Sreelakshmi, AdWords API Team

di...@easyleads.com

unread,
Jul 27, 2017, 2:57:14 AM7/27/17
to AdWords API Forum
Hi,

Looks like we migrated from 2.20.0 to 3.5.0.

It's not easy to share the exception since I can't reproduce it without causing problems to our software (I can create a lot of threads explicitly, but it will block our token for some time and it is what we tried to avoid).

Josh Radcliff (AdWords API Team)

unread,
Jul 27, 2017, 9:48:32 AM7/27/17
to AdWords API Forum
Hi,

Thanks for opening a GitHub issue on this (issue #121). Since this is specific to the Java client library, let's continue the discussion in the comments on the GitHub issue so we don't duplicate efforts.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages