Gracefully handle buck audit failure

Handle exception raised when invoking `buck audit` and exit
with an error message, instead of dumping a python Traceback.

Change-Id: I3786c4eddffa03117f4437314fc12ee68c689a85
This commit is contained in:
David Pursehouse 2014-09-01 11:21:29 +09:00
parent 546d22f0e0
commit 67c263f877

View File

@ -33,7 +33,11 @@ jars = set()
def link_jars(libs, directory): def link_jars(libs, directory):
makedirs(directory) makedirs(directory)
try:
cp = check_output(['buck', 'audit', 'classpath'] + libs) cp = check_output(['buck', 'audit', 'classpath'] + libs)
except Exception as e:
print('call to buck audit failed: %s' % e, file=sys.stderr)
exit(1)
for j in cp.strip().splitlines(): for j in cp.strip().splitlines():
if j not in jars: if j not in jars:
jars.add(j) jars.add(j)