From 7919edce31412664d68fb8ab7137b2e56563217f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 25 Dec 2022 02:16:54 -0500 Subject: [PATCH] Print stderr on subcommand failure --- mailman_sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mailman_sync.py b/mailman_sync.py index 59c272e..efbf539 100755 --- a/mailman_sync.py +++ b/mailman_sync.py @@ -62,4 +62,8 @@ if __name__ == "__main__": argp.add_argument("--list-suffix", help="Suffix for mailing lists") args = argp.parse_args() - main(args.bin, args.api, args.token, args.list_suffix) + try: + main(args.bin, args.api, args.token, args.list_suffix) + except subprocess.CalledProcessError as e: + print(e.stderr) + raise