Include repr() of the CmdResult object in str() of CmdError and AutoservRunError.  This should make it easier to debug problems with failed commands.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2018 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 14e253f..b56399f 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -107,6 +107,7 @@
                                               self.result_obj.exit_status)
         if self.additional_text:
             msg += ", " + self.additional_text
+        msg += '\n' + repr(self.result_obj)
         return msg
 
 
@@ -153,8 +154,13 @@
     run result object).
     """
     def __init__(self, description, result_obj):
+        self.description = description
+        self.result_obj = result_obj
         AutoservError.__init__(self, description, result_obj)
 
+    def __str__(self):
+        return self.description + '\n' + repr(self.result_obj)
+
 
 class AutoservVirtError(AutoservError):
     """Vitualization related error"""