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: