Skip to content

Exceptions

docstring_format_checker.utils.exceptions 🔗

Summary

This module defines custom exceptions for handling various error scenarios

DocstringError 🔗

Bases: Exception

Summary

Exception raised when a docstring validation error occurs.

Source code in src/docstring_format_checker/utils/exceptions.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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: str = message
        self.file_path: str = file_path
        self.line_number: int = line_number
        self.item_name: str = item_name
        self.item_type: str = 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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: str = message
    self.file_path: str = file_path
    self.line_number: int = line_number
    self.item_name: str = item_name
    self.item_type: str = item_type
    super().__init__(f"Line {line_number}, {item_type} '{item_name}': {message}")
message instance-attribute 🔗
message: str = message
file_path instance-attribute 🔗
file_path: str = file_path
line_number instance-attribute 🔗
line_number: int = line_number
item_name instance-attribute 🔗
item_name: str = item_name
item_type instance-attribute 🔗
item_type: str = item_type

InvalidConfigError 🔗

Bases: Exception

Summary

Exception raised for invalid configuration errors.

Source code in src/docstring_format_checker/utils/exceptions.py
61
62
63
64
65
66
67
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
70
71
72
73
74
75
76
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
79
80
81
82
83
84
85
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
88
89
90
91
92
93
94
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
 97
 98
 99
100
101
102
103
class DirectoryNotFoundError(OSError):
    """
    !!! note "Summary"
        Exception raised for directory not found errors.
    """

    pass