Coverage for src / ezcompiler / shared / exceptions / utils / __init__.py: 100.00%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-27 06:49 +0000

1# /////////////////////////////////////////////////////////////// 

2# EXCEPTIONS PACKAGE - Specialized exception hierarchy 

3# Project: ezcompiler 

4# /////////////////////////////////////////////////////////////// 

5 

6""" 

7Exceptions package - Specialized exceptions organized by module functionality. 

8 

9This package provides fine-grained exceptions for different layers and utilities 

10of the EzCompiler project, enabling precise error handling. 

11 

12Structure: 

13- file_exceptions: File and directory operation errors 

14- compiler_exceptions: Compiler operation errors 

15- uploader_exceptions: Upload operation errors 

16- validation_exceptions: Validation errors 

17- zip_exceptions: ZIP archive errors 

18- config_exceptions: Configuration errors 

19- template_exceptions: Template processing errors 

20""" 

21 

22from __future__ import annotations 

23 

24# /////////////////////////////////////////////////////////////// 

25# IMPORTS - Base exception 

26# /////////////////////////////////////////////////////////////// 

27from .base import EzCompilerError 

28 

29# /////////////////////////////////////////////////////////////// 

30# IMPORTS - Compiler exceptions 

31# /////////////////////////////////////////////////////////////// 

32from .compiler_exceptions import ( 

33 CompilationExecutionError, 

34 CompilerConfigValidationError, 

35 CompilerError, 

36 CompilerNotAvailableError, 

37 IncludeFilesFormatError, 

38 MainFileNotFoundError, 

39 OutputDirectoryError, 

40) 

41 

42# /////////////////////////////////////////////////////////////// 

43# IMPORTS - Config exceptions 

44# /////////////////////////////////////////////////////////////// 

45from .config_exceptions import ( 

46 CompilerOptionError, 

47 ConfigError, 

48 ConfigFieldValidationError, 

49 ConfigFileNotFoundError, 

50 ConfigFileParseError, 

51 ConfigPathError, 

52 IncludeFilesError, 

53 MissingRequiredConfigError, 

54 OutputFolderError, 

55 TomlNotAvailableError, 

56) 

57 

58# /////////////////////////////////////////////////////////////// 

59# IMPORTS - File exceptions 

60# /////////////////////////////////////////////////////////////// 

61from .file_exceptions import ( 

62 DirectoryCreationError, 

63 DirectoryListError, 

64 FileAccessError, 

65 FileCopyError, 

66 FileDeleteError, 

67 FileError, 

68 FileMoveError, 

69 FileNotFoundError, 

70 PathNormalizationError, 

71) 

72 

73# /////////////////////////////////////////////////////////////// 

74# IMPORTS - ZIP exceptions 

75# /////////////////////////////////////////////////////////////// 

76from .template_exceptions import ( 

77 TemplateFileWriteError, 

78 TemplateProcessingError, 

79 TemplateSubstitutionError, 

80 TemplateValidationError, 

81) 

82 

83# /////////////////////////////////////////////////////////////// 

84# IMPORTS - Uploader exceptions 

85# /////////////////////////////////////////////////////////////// 

86from .uploader_exceptions import ( 

87 BackupGenerationError, 

88 ServerConfigError, 

89 SourcePathError, 

90 UploadAuthenticationError, 

91 UploadConnectionError, 

92 UploaderTypeError, 

93 UploadTimeoutError, 

94) 

95 

96# /////////////////////////////////////////////////////////////// 

97# IMPORTS - Validation exceptions 

98# /////////////////////////////////////////////////////////////// 

99from .validation_exceptions import ( 

100 ChoiceValidationError, 

101 FormatValidationError, 

102 LengthValidationError, 

103 PatternValidationError, 

104 RangeValidationError, 

105 RequiredFieldError, 

106 SchemaValidationError, 

107 TypeValidationError, 

108 ValidationError, 

109) 

110from .zip_exceptions import ( 

111 ZipCompressionError, 

112 ZipCreationError, 

113 ZipError, 

114 ZipExtractionError, 

115 ZipFileCorruptedError, 

116 ZipFileNotFoundError, 

117 ZipPathError, 

118 ZipProgressError, 

119) 

120 

121# /////////////////////////////////////////////////////////////// 

122# PUBLIC API 

123# /////////////////////////////////////////////////////////////// 

124 

125__all__ = [ 

126 # Base exception 

127 "EzCompilerError", 

128 # File exceptions 

129 "FileError", 

130 "FileNotFoundError", 

131 "DirectoryCreationError", 

132 "FileAccessError", 

133 "FileCopyError", 

134 "FileMoveError", 

135 "FileDeleteError", 

136 "DirectoryListError", 

137 "PathNormalizationError", 

138 # Compiler exceptions 

139 "CompilerError", 

140 "CompilerConfigValidationError", 

141 "MainFileNotFoundError", 

142 "OutputDirectoryError", 

143 "IncludeFilesFormatError", 

144 "CompilerNotAvailableError", 

145 "CompilationExecutionError", 

146 # Uploader exceptions 

147 "SourcePathError", 

148 "UploaderTypeError", 

149 "ServerConfigError", 

150 "BackupGenerationError", 

151 "UploadConnectionError", 

152 "UploadAuthenticationError", 

153 "UploadTimeoutError", 

154 # Validation exceptions 

155 "ValidationError", 

156 "TypeValidationError", 

157 "FormatValidationError", 

158 "RangeValidationError", 

159 "LengthValidationError", 

160 "PatternValidationError", 

161 "SchemaValidationError", 

162 "ChoiceValidationError", 

163 "RequiredFieldError", 

164 # ZIP exceptions 

165 "ZipError", 

166 "ZipCreationError", 

167 "ZipExtractionError", 

168 "ZipFileNotFoundError", 

169 "ZipFileCorruptedError", 

170 "ZipPathError", 

171 "ZipProgressError", 

172 "ZipCompressionError", 

173 # Config exceptions 

174 "ConfigError", 

175 "ConfigFieldValidationError", 

176 "ConfigFileNotFoundError", 

177 "ConfigFileParseError", 

178 "ConfigPathError", 

179 "CompilerOptionError", 

180 "OutputFolderError", 

181 "IncludeFilesError", 

182 "MissingRequiredConfigError", 

183 "TomlNotAvailableError", 

184 # Template exceptions 

185 "TemplateProcessingError", 

186 "TemplateSubstitutionError", 

187 "TemplateFileWriteError", 

188 "TemplateValidationError", 

189]