aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-01-23 17:31:59 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-01-23 17:31:59 +0300
commit93e644a245f8d5f91332164846559de032faed21 (patch)
tree8f0c666dd114525d554b748722ae47995628cbc9 /app.py
parentdump exceptions to browser's console (diff)
downloadlinux-status-93e644a245f8d5f91332164846559de032faed21.tar.gz
linux-status-93e644a245f8d5f91332164846559de032faed21.zip
app.py: include command's output in the exception
Diffstat (limited to '')
-rwxr-xr-xapp.py5
1 files changed, 5 insertions, 0 deletions
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