Skip to content

exceptions.py

Module containing custom exceptions.

BasePathDoesNotExistError (Exception) ¤

Raised if the base path does not exist.

EmptyConfigYML (Exception) ¤

Raised if the config.yml file is empty.

MandatoryKeyNotFound (Exception) ¤

Raised if a mandatory key is not found in the config.yml.

MismatchedTokenError (Exception) ¤

Raised when the number of input tokens does not match the user config.

Attributes:

Name Type Description
expected int

number of input tokens in the user config.

given int

number of input tokens passed in.

__init__(self, expected, given) special ¤

Initialise the exception.

Parameters:

Name Type Description Default
expected int

number of input tokens in the user config.

required
given int

number of input tokens passed in.

required
Source code in tembo/exceptions.py
def __init__(self, expected: int, given: int) -> None:
    """
    Initialise the exception.

    Args:
        expected (int): number of input tokens in the user config.
        given (int): number of input tokens passed in.
    """
    self.expected = expected
    self.given = given
    super().__init__()

MissingConfigYML (Exception) ¤

Raised if the config.yml file is missing.

ScopeNotFound (Exception) ¤

Raised if the scope does not exist in the config.yml.

ScopedPageAlreadyExists (Exception) ¤

Raised if the scoped page file already exists.

TemplateFileNotFoundError (Exception) ¤

Raised if the template file does not exist.

Back to top