Bug 1385621 - Fix `mach artifact toolchain` handling of download exceptions after
bug 1364650. r?gps
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1929,24 +1929,24 @@ class PackageFrontend(MachCommandBase):
for attempt, _ in enumerate(redo.retrier(attempts=retry+1,
sleeptime=60)):
try:
record.fetch_with(cache)
except (requests.exceptions.HTTPError,
requests.exceptions.ChunkedEncodingError,
requests.exceptions.ConnectionError) as e:
- if isinstance(e, requests.exceptions.ConnectionError):
- should_retry = True
- else:
+ if isinstance(e, requests.exceptions.HTTPError):
# The relengapi proxy likes to return error 400 bad request
# which seems improbably to be due to our (simple) GET
# being borked.
status = e.response.status_code
should_retry = status >= 500 or status == 400
+ else:
+ should_retry = True
if should_retry or attempt < retry:
level = logging.WARN
else:
level = logging.ERROR
# e.message is not always a string, so convert it first.
self.log(level, 'artifact', {}, str(e.message))
if not should_retry: