1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

getdeps: introduce TransientFailure exception type

Summary:
The goal is to return an error code > 127 in the case of a
transient, retryable, infrastructure error.  This diff generates
those in the case of failure in downloading a URL or from interacting
with LFS.

Reviewed By: strager

Differential Revision: D15266838

fbshipit-source-id: 4f52a791320123968869032c37912dded464a86e
This commit is contained in:
Wez Furlong
2019-05-10 12:48:15 -07:00
committed by Facebook Github Bot
parent b1883448e3
commit b96314bea8
3 changed files with 33 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ import subprocess
import sys
from getdeps.buildopts import setup_build_options
from getdeps.errors import TransientFailure
from getdeps.load import load_project, manifests_in_dependency_order
from getdeps.manifest import ManifestParser
from getdeps.platform import HostType, context_from_host_tuple
@@ -407,7 +408,14 @@ def main():
return 0
try:
return args.func(args)
except subprocess.CalledProcessError:
except TransientFailure as exc:
print("TransientFailure: %s" % str(exc))
# This return code is treated as a retryable transient infrastructure
# error by Facebook's internal CI, rather than eg: a build or code
# related error that needs to be fixed before progress can be made.
return 128
except subprocess.CalledProcessError as exc:
print("%s" % str(exc), file=sys.stderr)
print("!! Failed", file=sys.stderr)
return 1