Enhance the error message displayed when a server-side test fails.
The existing message just indicates that a runtest function failed, and
gives you the exit code. We can at least display the name of the
failed test in the error message.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1301 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index a078b9c..8f5b203 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -106,3 +106,13 @@
class AutoservRebootError(AutoservError):
"""Error occured while rebooting a machine"""
pass
+
+class AutoservSubcommandError(AutoservError):
+ """Indicates an error while executing a (forked) subcommand"""
+ def __init__(self, func, exit_code):
+ AutoservError.__init__(self, func, exit_code)
+ self.func = func
+ self.exit_code = exit_code
+ def __str__(self):
+ return ("Subcommand %s failed with exit code %d" %
+ self.func, self.exit_code)