Skip to content

Exceptions

docstring_format_checker.utils.exceptions 🔗

DocstringError 🔗

Bases: Exception

Summary

Exception raised when a docstring validation error occurs.

Source code in src/docstring_format_checker/utils/exceptions.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class DocstringError(Exception):
    """
    !!! note "Summary"
        Exception raised when a docstring validation error occurs.
    """

    def __init__(
        self,
        message: str,
        file_path: str,
        line_number: int,
        item_name: str,
        item_type: str,
    ) -> None:
        """
        !!! note "Summary"
            Initialize a DocstringError.
        """
        self.message = message
        self.file_path = file_path
        self.line_number = line_number
        self.item_name = item_name
        self.item_type = item_type
        super().__init__(f"Line {line_number}, {item_type} '{item_name}': {message}")
__init__ 🔗
__init__(
    message: str,
    file_path: str,
    line_number: int,
    item_name: str,
    item_type: str,
) -> None

Summary

Initialize a DocstringError.

Source code in src/docstring_format_checker/utils/exceptions.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def __init__(
    self,
    message: str,
    file_path: str,
    line_number: int,
    item_name: str,
    item_type: str,
) -> None:
    """
    !!! note "Summary"
        Initialize a DocstringError.
    """
    self.message = message
    self.file_path = file_path
    self.line_number = line_number
    self.item_name = item_name
    self.item_type = item_type
    super().__init__(f"Line {line_number}, {item_type} '{item_name}': {message}")
message instance-attribute 🔗
message = message
file_path instance-attribute 🔗
file_path = file_path
line_number instance-attribute 🔗
line_number = line_number
item_name instance-attribute 🔗
item_name = item_name
item_type instance-attribute 🔗
item_type = item_type

InvalidConfigError 🔗

Bases: Exception

Summary

Exception raised for invalid configuration errors.

Source code in src/docstring_format_checker/utils/exceptions.py
27
28
29
30
31
32
33
class InvalidConfigError(Exception):
    """
    !!! note "Summary"
        Exception raised for invalid configuration errors.
    """

    pass

InvalidConfigError_DuplicateOrderValues 🔗

Bases: Exception

Summary

Exception raised for duplicate order values in configuration.

Source code in src/docstring_format_checker/utils/exceptions.py
36
37
38
39
40
41
42
class InvalidConfigError_DuplicateOrderValues(Exception):
    """
    !!! note "Summary"
        Exception raised for duplicate order values in configuration.
    """

    pass

InvalidTypeValuesError 🔗

Bases: Exception

Summary

Exception raised for invalid type values in configuration.

Source code in src/docstring_format_checker/utils/exceptions.py
45
46
47
48
49
50
51
class InvalidTypeValuesError(Exception):
    """
    !!! note "Summary"
        Exception raised for invalid type values in configuration.
    """

    pass

InvalidFileError 🔗

Bases: OSError

Summary

Exception raised for invalid file errors.

Source code in src/docstring_format_checker/utils/exceptions.py
54
55
56
57
58
59
60
class InvalidFileError(OSError):
    """
    !!! note "Summary"
        Exception raised for invalid file errors.
    """

    pass

DirectoryNotFoundError 🔗

Bases: OSError

Summary

Exception raised for directory not found errors.

Source code in src/docstring_format_checker/utils/exceptions.py
63
64
65
66
67
68
69
class DirectoryNotFoundError(OSError):
    """
    !!! note "Summary"
        Exception raised for directory not found errors.
    """

    pass