From d0d15f966c0e19bda75c48f0db035b3b7dbf6835 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Wed, 13 May 2015 08:21:11 -0700 Subject: [PATCH] More informative error when command fails Instead of: ERROR|dox.cmd|Operation failed, aborting dox. we get: ERROR|dox.cmd|Operation failed, aborting dox. Traceback (most recent call last): File "/Users/marca/dev/git-repos/dox/dox/cmd.py", line 99, in run_dox map(run, images) File "/Users/marca/dev/git-repos/dox/dox/runner.py", line 209, in run self.build_test_image(image, command) File "/Users/marca/dev/git-repos/dox/dox/runner.py", line 157, in build_test_image shutil.copy(add_file, os.path.join(tempd, add_file)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 119, in copy copyfile(src, dst) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: 'tests_require.txt' Change-Id: Icdb25ae2c2f06ffab416d215a7f8b360f9b65c1e --- dox/cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dox/cmd.py b/dox/cmd.py index fb2cd05..1c002cf 100644 --- a/dox/cmd.py +++ b/dox/cmd.py @@ -97,8 +97,8 @@ def run_dox(args, images, command, image_name): run = functools.partial(dox.runner.Runner(args, image_name).run, command=command) map(run, images) - except Exception: - logger.error("Operation failed, aborting dox.", exc_info=args.debug) + except Exception as e: + logger.error("Operation failed, aborting dox.", exc_info=e) return 1