class FormulaError (RuntimeError):
    """The root of all formula execution error."""
    pass

class FormulaArgumentError(FormulaError):
    "checks for required number of arguments error"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class FormulaExecutionError(FormulaError):
    "checks for required number of arguments error"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class FormulaTypeMismatchError(FormulaError):
    "Checks data type matching error"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class InstanceNotFoundError(RuntimeError):
    "When instance is not saved or not found in the session"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class NumberFormatError(RuntimeError):
    "When a string received when number needed"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class CommandError(RuntimeError):
    "checks for commands which does not exist in component"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value

class ServerError (RuntimeError):
    """The root of all server error."""
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value

class MetadataError(ServerError):
    "checks for any error in accessing metadata"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value

class DataError(ServerError):
    "checks for any error in accessing data"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value

class CustomCommandError(CommandError):
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return repr(self.value)

class ProcessEngineError(RuntimeError):
    "Error while Workflow or Action execution"
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value

class ReportEngineError(RuntimeError):
    def __init__(self, value):
        self.value = value
    def __str__(self):
        return self.value
