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

1class DocstringError(Exception): 

2 """ 

3 !!! note "Summary" 

4 Exception raised when a docstring validation error occurs. 

5 """ 

6 

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}") 

25 

26 

27class InvalidConfigError(Exception): 

28 """ 

29 !!! note "Summary" 

30 Exception raised for invalid configuration errors. 

31 """ 

32 

33 pass 

34 

35 

36class InvalidConfigError_DuplicateOrderValues(Exception): 

37 """ 

38 !!! note "Summary" 

39 Exception raised for duplicate order values in configuration. 

40 """ 

41 

42 pass 

43 

44 

45class InvalidTypeValuesError(Exception): 

46 """ 

47 !!! note "Summary" 

48 Exception raised for invalid type values in configuration. 

49 """ 

50 

51 pass 

52 

53 

54class InvalidFileError(OSError): 

55 """ 

56 !!! note "Summary" 

57 Exception raised for invalid file errors. 

58 """ 

59 

60 pass 

61 

62 

63class DirectoryNotFoundError(OSError): 

64 """ 

65 !!! note "Summary" 

66 Exception raised for directory not found errors. 

67 """ 

68 

69 pass