diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -2806,6 +2806,8 @@ class Project: | |||
2806 | def _FetchBundle(self, srcUrl, tmpPath, dstPath, quiet, verbose): | 2806 | def _FetchBundle(self, srcUrl, tmpPath, dstPath, quiet, verbose): |
2807 | platform_utils.remove(dstPath, missing_ok=True) | 2807 | platform_utils.remove(dstPath, missing_ok=True) |
2808 | 2808 | ||
2809 | # We do not use curl's --retry option since it generally doesn't | ||
2810 | # actually retry anything; code 18 for example, it will not retry on. | ||
2809 | cmd = ["curl", "--fail", "--output", tmpPath, "--netrc", "--location"] | 2811 | cmd = ["curl", "--fail", "--output", tmpPath, "--netrc", "--location"] |
2810 | if quiet: | 2812 | if quiet: |
2811 | cmd += ["--silent", "--show-error"] | 2813 | cmd += ["--silent", "--show-error"] |
@@ -2842,11 +2844,18 @@ class Project: | |||
2842 | (output, _) = proc.communicate() | 2844 | (output, _) = proc.communicate() |
2843 | curlret = proc.returncode | 2845 | curlret = proc.returncode |
2844 | 2846 | ||
2845 | if curlret == 22: | 2847 | if curlret in (22, 35, 56, 92): |
2848 | # We use --fail so curl exits with unique status. | ||
2846 | # From curl man page: | 2849 | # From curl man page: |
2847 | # 22: HTTP page not retrieved. The requested url was not found | 2850 | # 22: HTTP page not retrieved. The requested url was not found |
2848 | # or returned another error with the HTTP error code being 400 | 2851 | # or returned another error with the HTTP error code being |
2849 | # or above. This return code only appears if -f, --fail is used. | 2852 | # 400 or above. |
2853 | # 35: SSL connect error. The SSL handshaking failed. This can | ||
2854 | # be thrown by Google storage sometimes. | ||
2855 | # 56: Failure in receiving network data. This shows up with | ||
2856 | # HTTP/404 on Google storage. | ||
2857 | # 92: Stream error in HTTP/2 framing layer. Basically the same | ||
2858 | # as 22 -- Google storage sometimes throws 500's. | ||
2850 | if verbose: | 2859 | if verbose: |
2851 | print( | 2860 | print( |
2852 | "%s: Unable to retrieve clone.bundle; ignoring." | 2861 | "%s: Unable to retrieve clone.bundle; ignoring." |