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

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/5d2e6fdd-22a5-48cc-a4f2-a07b362db101%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Google ... Mat
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to