Skip to content

Errors

TokenNotFound

Bases: RuntimeError

The token was not found.

Source code in aoc/errors.py
17
18
19
20
21
22
23
24
25
26
27
28
class TokenNotFound(RuntimeError):
    """The token was not found."""

    def __init__(self, path: Path) -> None:
        super().__init__(token_not_found(path.as_posix()))

        self._path = path

    @property
    def path(self) -> Path:
        """The token path."""
        return self._path

path: Path property

The token path.

DataNotFound

Bases: RuntimeError

The data for the problem was not found.

Source code in aoc/errors.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class DataNotFound(RuntimeError):
    """The data for the problem was not found."""

    def __init__(self, key: Key, path: Path) -> None:
        super().__init__(data_not_found(key, path.as_posix()))

        self._key = key
        self._path = path

    @property
    def key(self) -> Key:
        """The key of the problem."""
        return self._key

    @property
    def path(self) -> Path:
        """The path to the problem's data file."""
        return self._path

key: Key property

The key of the problem.

path: Path property

The path to the problem's data file.

InternalError

Bases: RuntimeError

Represents internal errors in the library.

Source code in aoc/errors.py
55
56
class InternalError(RuntimeError):
    """Represents internal errors in the library."""