From 7976aacdf6827558d01fffa0320fcc9354e32094 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 3 Mar 2016 15:30:49 +0100 Subject: [PATCH] worlddump: log command failure details If a command we trigger fails for some reason, it's worth logging details about the failure (like return code). Change-Id: Ib19aa474eccdd11e138a4f55e125935b621bca05 --- tools/worlddump.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/worlddump.py b/tools/worlddump.py index 01f601cea8..72a257fa8c 100755 --- a/tools/worlddump.py +++ b/tools/worlddump.py @@ -58,8 +58,8 @@ def _dump_cmd(cmd): try: subprocess.check_call(cmd, shell=True) print - except subprocess.CalledProcessError: - print "*** Failed to run: %s" % cmd + except subprocess.CalledProcessError as e: + print "*** Failed to run '%(cmd)s': %(err)s" % {'cmd': cmd, 'err': e} def _find_cmd(cmd):