Coverage for tembo/exceptions.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Module containing custom exceptions."""
4class MismatchedTokenError(Exception):
5 """
6 Raised when the number of input tokens does not match the user config.
8 Attributes:
9 expected (int): number of input tokens in the user config.
10 given (int): number of input tokens passed in.
11 """
13 def __init__(self, expected: int, given: int) -> None:
14 """
15 Initialise the exception.
17 Args:
18 expected (int): number of input tokens in the user config.
19 given (int): number of input tokens passed in.
20 """
21 self.expected = expected
22 self.given = given
23 super().__init__()
26class BasePathDoesNotExistError(Exception):
27 """Raised if the base path does not exist."""
30class TemplateFileNotFoundError(Exception):
31 """Raised if the template file does not exist."""
34class ScopedPageAlreadyExists(Exception):
35 """Raised if the scoped page file already exists."""
38class MissingConfigYML(Exception):
39 """Raised if the config.yml file is missing."""
42class EmptyConfigYML(Exception):
43 """Raised if the config.yml file is empty."""
46class ScopeNotFound(Exception):
47 """Raised if the scope does not exist in the config.yml."""
50class MandatoryKeyNotFound(Exception):
51 """Raised if a mandatory key is not found in the config.yml."""