blob: 52aab2d5f9df38e0d3bf40d1bdd450f611666c09 [file] [log] [blame]
from exceptions import Exception
class CheckerBaseExceptions(Exception):
pass
class CheckerException(CheckerBaseExceptions):
def __init__(self, message, *args, **kwargs):
super(CheckerException, self).__init__(message, *args, **kwargs)
# get the trace
# TODO: get and log traceback
# prettify message
self.message = "# CheckerException: {}".format(message)
class ConfigException(CheckerException):
def __init__(self, message, *args, **kwargs):
super(ConfigException, self).__init__(message, *args, **kwargs)
self.message = "# Configuration error: {}".format(message)
class SaltException(CheckerException):
def __init__(self, message, *args, **kwargs):
super(SaltException, self).__init__(message, *args, **kwargs)
self.message = "# Salt error: {}".format(message)
class InvalidReturnException(CheckerException):
def __init__(self, message, *args, **kwargs):
super(InvalidReturnException, self).__init__(message, *args, **kwargs)
self.message = "# Unexpected return value: {}".format(message)
class ErrorMappingException(CheckerException):
def __init__(self, message, *args, **kwargs):
super(ErrorMappingException, self).__init__(message, *args, **kwargs)
self.message = "# Unexpected error mapping/type: {}".format(message)