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

13 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-07-04 11:22 +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 - Installer exceptions 

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

76from ._installer_exceptions import ( 

77 InstallerBuildError, 

78 InstallerConfigError, 

79 InstallerError, 

80 InstallerTypeError, 

81 IsccNotFoundError, 

82) 

83 

84# /////////////////////////////////////////////////////////////// 

85# IMPORTS - Release exceptions 

86# /////////////////////////////////////////////////////////////// 

87from ._release_exceptions import ( 

88 BundleBuildError, 

89 ReleaseConfigError, 

90 ReleaseError, 

91 ReleaserTypeError, 

92 SigningKeyError, 

93) 

94 

95# /////////////////////////////////////////////////////////////// 

96# IMPORTS - ZIP exceptions 

97# /////////////////////////////////////////////////////////////// 

98from ._template_exceptions import ( 

99 TemplateFileWriteError, 

100 TemplateProcessingError, 

101 TemplateSubstitutionError, 

102 TemplateValidationError, 

103) 

104 

105# /////////////////////////////////////////////////////////////// 

106# IMPORTS - Updater exceptions 

107# /////////////////////////////////////////////////////////////// 

108from ._updater_exceptions import ( 

109 UpdaterConfigError, 

110 UpdaterError, 

111 UpdaterGenerationError, 

112) 

113 

114# /////////////////////////////////////////////////////////////// 

115# IMPORTS - Uploader exceptions 

116# /////////////////////////////////////////////////////////////// 

117from ._uploader_exceptions import ( 

118 BackupGenerationError, 

119 ServerConfigError, 

120 SourcePathError, 

121 UploadAuthenticationError, 

122 UploadConnectionError, 

123 UploaderTypeError, 

124 UploadTimeoutError, 

125) 

126 

127# /////////////////////////////////////////////////////////////// 

128# IMPORTS - Validation exceptions 

129# /////////////////////////////////////////////////////////////// 

130from ._validation_exceptions import ( 

131 ChoiceValidationError, 

132 FormatValidationError, 

133 LengthValidationError, 

134 PatternValidationError, 

135 RangeValidationError, 

136 RequiredFieldError, 

137 SchemaValidationError, 

138 TypeValidationError, 

139 ValidationError, 

140) 

141from ._zip_exceptions import ( 

142 ZipCompressionError, 

143 ZipCreationError, 

144 ZipError, 

145 ZipExtractionError, 

146 ZipFileCorruptedError, 

147 ZipFileNotFoundError, 

148 ZipPathError, 

149 ZipProgressError, 

150) 

151 

152# /////////////////////////////////////////////////////////////// 

153# PUBLIC API 

154# /////////////////////////////////////////////////////////////// 

155 

156__all__ = [ 

157 # Base exception 

158 "EzCompilerError", 

159 # File exceptions 

160 "FileError", 

161 "FileNotFoundError", 

162 "DirectoryCreationError", 

163 "FileAccessError", 

164 "FileCopyError", 

165 "FileMoveError", 

166 "FileDeleteError", 

167 "DirectoryListError", 

168 "PathNormalizationError", 

169 # Compiler exceptions 

170 "CompilerError", 

171 "CompilerConfigValidationError", 

172 "MainFileNotFoundError", 

173 "OutputDirectoryError", 

174 "IncludeFilesFormatError", 

175 "CompilerNotAvailableError", 

176 "CompilationExecutionError", 

177 # Release exceptions 

178 "ReleaseError", 

179 "ReleaserTypeError", 

180 "BundleBuildError", 

181 "SigningKeyError", 

182 "ReleaseConfigError", 

183 # Installer exceptions 

184 "InstallerError", 

185 "InstallerTypeError", 

186 "IsccNotFoundError", 

187 "InstallerBuildError", 

188 "InstallerConfigError", 

189 # Updater exceptions 

190 "UpdaterError", 

191 "UpdaterConfigError", 

192 "UpdaterGenerationError", 

193 # Uploader exceptions 

194 "SourcePathError", 

195 "UploaderTypeError", 

196 "ServerConfigError", 

197 "BackupGenerationError", 

198 "UploadConnectionError", 

199 "UploadAuthenticationError", 

200 "UploadTimeoutError", 

201 # Validation exceptions 

202 "ValidationError", 

203 "TypeValidationError", 

204 "FormatValidationError", 

205 "RangeValidationError", 

206 "LengthValidationError", 

207 "PatternValidationError", 

208 "SchemaValidationError", 

209 "ChoiceValidationError", 

210 "RequiredFieldError", 

211 # ZIP exceptions 

212 "ZipError", 

213 "ZipCreationError", 

214 "ZipExtractionError", 

215 "ZipFileNotFoundError", 

216 "ZipFileCorruptedError", 

217 "ZipPathError", 

218 "ZipProgressError", 

219 "ZipCompressionError", 

220 # Config exceptions 

221 "ConfigError", 

222 "ConfigFieldValidationError", 

223 "ConfigFileNotFoundError", 

224 "ConfigFileParseError", 

225 "ConfigPathError", 

226 "CompilerOptionError", 

227 "OutputFolderError", 

228 "IncludeFilesError", 

229 "MissingRequiredConfigError", 

230 "TomlNotAvailableError", 

231 # Template exceptions 

232 "TemplateProcessingError", 

233 "TemplateSubstitutionError", 

234 "TemplateFileWriteError", 

235 "TemplateValidationError", 

236]