diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-23 17:31:59 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-23 17:31:59 +0300 |
commit | 93e644a245f8d5f91332164846559de032faed21 (patch) | |
tree | 8f0c666dd114525d554b748722ae47995628cbc9 | |
parent | dump exceptions to browser's console (diff) | |
download | linux-status-93e644a245f8d5f91332164846559de032faed21.tar.gz linux-status-93e644a245f8d5f91332164846559de032faed21.zip |
app.py: include command's output in the exception
-rwxr-xr-x | app.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |