Properly space error.py according to coding style
Signed-off-by: Martin J. Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1633 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 0051cdb..f1cc010 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -14,31 +14,38 @@
return ''.join(trace)
+
class JobContinue(SystemExit):
"""Allow us to bail out requesting continuance."""
pass
+
class JobComplete(SystemExit):
"""Allow us to bail out indicating continuation not required."""
pass
+
class AutotestError(Exception):
"""The parent of all errors deliberatly thrown within the client code."""
pass
+
class JobError(AutotestError):
"""Indicates an error which terminates and fails the whole job."""
pass
+
class TestError(AutotestError):
"""Indicates an error which terminates and fails the test."""
pass
+
class TestNAError(AutotestError):
"""Indictates that the test is Not Applicable. Should be thrown
when various conditions are such that the test is inappropriate"""
pass
+
class CmdError(TestError):
"""\
Indicates that a command failed, is fatal to the test unless caught.
@@ -54,23 +61,28 @@
msg += ", " + self.args[2]
return msg
+
class PackageError(TestError):
"""Indicates an error trying to perform a package operation."""
pass
+
class UnhandledError(TestError):
"""Indicates an unhandled exception in a test."""
def __init__(self, prefix):
msg = prefix + format_error()
TestError.__init__(self, msg)
+
class InstallError(JobError):
"""Indicates an installation error which Terminates and fails the job."""
pass
+
class AutotestRunError(AutotestError):
pass
+
class AutotestTimeoutError(AutotestError):
"""This exception is raised when an autotest test exceeds the timeout
parameter passed to run_timed_test and is killed.
@@ -107,20 +119,24 @@
"""Error raised when you try to use an unsupported optional feature"""
pass
+
class AutoservHostError(AutoservError):
"""Error reaching a host"""
pass
+
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))