Jelajahi Sumber

Don't exit with error on HTTP 403 when downloading clone bundle

If the server returns HTTP 403 (forbidden) when attempting to
download clone bundle files, ignore it and continue, rather than
exiting with a fatal error.

Change-Id: Icf78cba0332b51b0e7b622f7c7924369b551b6f6
David Pursehouse 13 tahun lalu
induk
melakukan
87b9d9b4f2
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      repo

+ 1 - 1
repo

@@ -428,7 +428,7 @@ def _DownloadBundle(url, local, quiet):
     try:
     try:
       r = urllib.request.urlopen(url)
       r = urllib.request.urlopen(url)
     except urllib.error.HTTPError as e:
     except urllib.error.HTTPError as e:
-      if e.code == 404:
+      if e.code in [403, 404]:
         return False
         return False
       print('fatal: Cannot get %s' % url, file=sys.stderr)
       print('fatal: Cannot get %s' % url, file=sys.stderr)
       print('fatal: HTTP error %s' % e.code, file=sys.stderr)
       print('fatal: HTTP error %s' % e.code, file=sys.stderr)