From 93e644a245f8d5f91332164846559de032faed21 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 23 Jan 2022 17:31:59 +0300 Subject: app.py: include command's output in the exception --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index 3638151..1ed34a0 100755 --- a/app.py +++ b/app.py @@ -118,6 +118,11 @@ class Response: def run_do(*args, **kwargs): output = subprocess.run(args, stdin=DEVNULL, stdout=PIPE, stderr=STDOUT, universal_newlines=True, **kwargs) + # Include the output in the exception's message: + try: + output.check_returncode() + except Exception as e: + raise RuntimeError("Command's output was this:\n" + output.stdout) from e return output.stdout -- cgit v1.2.3