From 67c263f877c6e95039694a90e0af17187b25403b Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 1 Sep 2014 11:21:29 +0900 Subject: [PATCH] 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 --- tools/pack_war.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/pack_war.py b/tools/pack_war.py index 6c71d81bd3..f794c5c8b2 100755 --- a/tools/pack_war.py +++ b/tools/pack_war.py @@ -33,7 +33,11 @@ jars = set() def link_jars(libs, directory): makedirs(directory) - cp = check_output(['buck', 'audit', 'classpath'] + libs) + try: + 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(): if j not in jars: jars.add(j)