|
|
|
Created:
13 years, 1 month ago by hinoka Modified:
13 years, 1 month ago CC:
codereview-discuss_googlegroups.com Visibility:
Public. |
Started as: https://codereview.chromium.org/11446068/
Catching urllib2.URLError
These sometimes occur when an intermediate proxy is overloaded, and is only an temporary issue.
We want to catch these exceptions and retry uploading.
Patch Set 1 #
Total comments: 2
Total messages: 2
|
hinoka
|
13 years, 1 month ago (2012年12月07日 21:35:41 UTC) #1 | ||||||||||||||
https://codereview.appspot.com/6912052/diff/1/third_party/upload.py File third_party/upload.py (right): https://codereview.appspot.com/6912052/diff/1/third_party/upload.py#newcode424 third_party/upload.py:424: elif e.reason == '[Errno 110] Connection timed out': I'm not sure the error code is portable. So I'd prefer with elif 'Connection timed out' in e.reason: but see my comment below. https://codereview.appspot.com/6912052/diff/1/third_party/upload.py#newcode431 third_party/upload.py:431: raise e "raise" is better than "raise e" since it re-raise the original exception. That's what you did at line 423. I don't think it's useful to have 3 condition blocks, you really only need one; if 'Connection timed out' in e.reason and tries <= 3: # retry with backoff (...) continue raise that's it.