Hi,
I keep getting the occational 504 Deadline Exceeded error while using the Google Ads API, where I never got this error before while using the AdWords API (for the same tasks).
There seems to be no pattern and usually I can't reproduce the error. It occures randomly in about one of several hundred queries, but some of them are crucial. So I want to catch this error, wait a minute and send the request again. But I'm struggling with how to catch this error.
I've tried somthing like this, but it won't catch this type of error but raises the error immediately without retry:
for i in range(4):
try:
results = ga_service.search(customer_id, query=query, page_size=PAGE_SIZE)
break
except Exception as error:
print("Error on try %s: %s" % (i, error))
if i == 3:
raise
else:
time.sleep(60)
continue
except:
print("Error on try %s" % (i))
if i == 3:
raise
else:
time.sleep(60)
continue
What's wrong?
Regards
Mat