From 83d063b670ee70fff1f224f57a9e435bdf8b7a51 Mon Sep 17 00:00:00 2001 From: Don Garrett Date: Thu, 20 Jan 2011 11:44:41 -0800 Subject: [PATCH] Pass along RunCommandException correctly. This is a minor fix, but it leads to better error messages from ctest. Change-Id: I624ad805ef037b022e6e67b56f0ed10ca05fe325 BUG=11096 TEST=Test currently in progress. Review URL: http://codereview.chromium.org/6257007 --- lib/cros_build_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cros_build_lib.py b/lib/cros_build_lib.py index 2e6876060c..ec7c028167 100644 --- a/lib/cros_build_lib.py +++ b/lib/cros_build_lib.py @@ -81,9 +81,9 @@ def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, raise RunCommandException('Command "%r" failed.\n' % (cmd) + (error_message or error or output or '')) - except Exception, e: + except RunCommandException as e: if not error_ok and retry_count == num_retries: - raise RunCommandException(e) + raise e else: Warning(str(e)) if print_cmd: