diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index e19f86f4b3a7..047f0a140f75 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -1784,12 +1784,18 @@ class PackageFrontend(MachCommandBase): sleeptime=60)): try: record.fetch_with(cache) - except requests.exceptions.HTTPError as e: - status = e.response.status_code - # The relengapi proxy likes to return error 400 bad request - # which seems improbably to be due to our (simple) GET - # being borked. - should_retry = status >= 500 or status == 400 + except (requests.exceptions.HTTPError, + requests.exceptions.ConnectionError) as e: + + if isinstance(e, requests.exceptions.ConnectionError) + should_retry = True + else: + # 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 + if should_retry or attempt < retry: level = logging.WARN else: