From 36c009d4659b2f30429d2729530770ace447ee4c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 4 Apr 2011 15:47:32 -0400 Subject: [PATCH] codereview: only retry on HTTP 500 error R=r CC=golang-dev https://golang.org/cl/4353047 --- lib/codereview/codereview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 7043abc1ea..3a70a1091a 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -1741,7 +1741,7 @@ def DownloadCL(ui, repo, clname): set_status("downloading CL " + clname) cl, err = LoadCL(ui, repo, clname) if err != "": - return None, None, "error loading CL %s: %s" % (clname, ExceptionDetail()) + return None, None, "error loading CL %s: %s" % (clname, err) # Grab RSS feed to learn about CL feed = XMLGet(ui, "/rss/issue/" + clname) @@ -1800,7 +1800,7 @@ def MySend(request_path, payload=None, try: return MySend1(request_path, payload, content_type, timeout, force_auth, **kwargs) except Exception, e: - if type(e) == urllib2.HTTPError and e.code == 403: # forbidden, it happens + if type(e) != urllib2.HTTPError or e.code != 500: # only retry on HTTP 500 error raise print >>sys.stderr, "Loading "+request_path+": "+ExceptionDetail()+"; trying again in 2 seconds." time.sleep(2)