[damned-lies] Also output command in run_shell_command OSError



commit ed39ed7c817fa0d0b56d4b85fca80721b5528a05
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri May 25 19:34:49 2018 +0200

    Also output command in run_shell_command OSError

 common/utils.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/common/utils.py b/common/utils.py
index 4757fdff..d6d89040 100644
--- a/common/utils.py
+++ b/common/utils.py
@@ -42,7 +42,10 @@ def run_shell_command(cmd, input_data=None, raise_on_error=False, env=None,
     status = pipe.returncode
     logging.debug(output + errout)
     if raise_on_error and status != STATUS_OK:
-        raise OSError(status, errout if errout else output)
+        raise OSError(
+            status,
+            'Command: "%s", Error: %s' % (cmd, errout.decode('utf-8') if errout else output)
+        )
 
     return (status, output.decode('utf-8'), errout.decode('utf-8'))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]