Coverage for cfg_checker/common/exception.py : 55%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
2class CheckerBaseExceptions(Exception):
3 pass
6class CheckerException(CheckerBaseExceptions):
7 def __init__(self, message, *args, **kwargs):
8 super(CheckerException, self).__init__(message, *args, **kwargs)
9 # get the trace
10 # TODO: get and log traceback
12 # prettify message
13 self.message = "# CheckerException: {}".format(message)
16class ConfigException(CheckerException):
17 def __init__(self, message, *args, **kwargs):
18 super(ConfigException, self).__init__(message, *args, **kwargs)
19 self.message = "# Configuration error: {}".format(message)
22class SaltException(CheckerException):
23 def __init__(self, message, *args, **kwargs):
24 super(SaltException, self).__init__(message, *args, **kwargs)
25 self.message = "# Salt error: {}".format(message)
28class InvalidReturnException(CheckerException):
29 def __init__(self, message, *args, **kwargs):
30 super(InvalidReturnException, self).__init__(message, *args, **kwargs)
31 self.message = "# Unexpected return value: {}".format(message)
34class ErrorMappingException(CheckerException):
35 def __init__(self, message, *args, **kwargs):
36 super(ErrorMappingException, self).__init__(message, *args, **kwargs)
37 self.message = "# Unexpected error mapping/type: {}".format(message)