Coverage for src/docstring_format_checker/utils/exceptions.py: 100%
18 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-10 13:31 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-10 13:31 +0000
1class DocstringError(Exception):
2 """
3 !!! note "Summary"
4 Exception raised when a docstring validation error occurs.
5 """
7 def __init__(
8 self,
9 message: str,
10 file_path: str,
11 line_number: int,
12 item_name: str,
13 item_type: str,
14 ) -> None:
15 """
16 !!! note "Summary"
17 Initialize a DocstringError.
18 """
19 self.message = message
20 self.file_path = file_path
21 self.line_number = line_number
22 self.item_name = item_name
23 self.item_type = item_type
24 super().__init__(f"Line {line_number}, {item_type} '{item_name}': {message}")
27class InvalidConfigError(Exception):
28 """
29 !!! note "Summary"
30 Exception raised for invalid configuration errors.
31 """
33 pass
36class InvalidConfigError_DuplicateOrderValues(Exception):
37 """
38 !!! note "Summary"
39 Exception raised for duplicate order values in configuration.
40 """
42 pass
45class InvalidTypeValuesError(Exception):
46 """
47 !!! note "Summary"
48 Exception raised for invalid type values in configuration.
49 """
51 pass
54class InvalidFileError(OSError):
55 """
56 !!! note "Summary"
57 Exception raised for invalid file errors.
58 """
60 pass
63class DirectoryNotFoundError(OSError):
64 """
65 !!! note "Summary"
66 Exception raised for directory not found errors.
67 """
69 pass