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