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

14 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-16 16:37 +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 InstallerRenderError, 

81 InstallerTypeError, 

82 IsccNotFoundError, 

83) 

84 

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

86# IMPORTS - Publish exceptions 

87# /////////////////////////////////////////////////////////////// 

88from ._publish_exceptions import ( 

89 PublishAuthError, 

90 PublishCliError, 

91 PublishError, 

92 PublisherTypeError, 

93) 

94 

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

96# IMPORTS - Release exceptions 

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

98from ._release_exceptions import ( 

99 BundleBuildError, 

100 ReleaseConfigError, 

101 ReleaseError, 

102 ReleaserTypeError, 

103 SigningKeyError, 

104) 

105 

106# /////////////////////////////////////////////////////////////// 

107# IMPORTS - ZIP exceptions 

108# /////////////////////////////////////////////////////////////// 

109from ._template_exceptions import ( 

110 TemplateFileWriteError, 

111 TemplateProcessingError, 

112 TemplateSubstitutionError, 

113 TemplateValidationError, 

114) 

115 

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

117# IMPORTS - Updater exceptions 

118# /////////////////////////////////////////////////////////////// 

119from ._updater_exceptions import ( 

120 UpdaterConfigError, 

121 UpdaterError, 

122 UpdaterGenerationError, 

123) 

124 

125# /////////////////////////////////////////////////////////////// 

126# IMPORTS - Uploader exceptions 

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

128from ._uploader_exceptions import ( 

129 BackupGenerationError, 

130 ServerConfigError, 

131 SourcePathError, 

132 UploadAuthenticationError, 

133 UploadConnectionError, 

134 UploaderTypeError, 

135 UploadTimeoutError, 

136) 

137 

138# /////////////////////////////////////////////////////////////// 

139# IMPORTS - Validation exceptions 

140# /////////////////////////////////////////////////////////////// 

141from ._validation_exceptions import ( 

142 ChoiceValidationError, 

143 FormatValidationError, 

144 LengthValidationError, 

145 PatternValidationError, 

146 RangeValidationError, 

147 RequiredFieldError, 

148 SchemaValidationError, 

149 TypeValidationError, 

150 ValidationError, 

151) 

152from ._zip_exceptions import ( 

153 ZipCompressionError, 

154 ZipCreationError, 

155 ZipError, 

156 ZipExtractionError, 

157 ZipFileCorruptedError, 

158 ZipFileNotFoundError, 

159 ZipPathError, 

160 ZipProgressError, 

161) 

162 

163# /////////////////////////////////////////////////////////////// 

164# PUBLIC API 

165# /////////////////////////////////////////////////////////////// 

166 

167__all__ = [ 

168 # Base exception 

169 "EzCompilerError", 

170 # File exceptions 

171 "FileError", 

172 "FileNotFoundError", 

173 "DirectoryCreationError", 

174 "FileAccessError", 

175 "FileCopyError", 

176 "FileMoveError", 

177 "FileDeleteError", 

178 "DirectoryListError", 

179 "PathNormalizationError", 

180 # Compiler exceptions 

181 "CompilerError", 

182 "CompilerConfigValidationError", 

183 "MainFileNotFoundError", 

184 "OutputDirectoryError", 

185 "IncludeFilesFormatError", 

186 "CompilerNotAvailableError", 

187 "CompilationExecutionError", 

188 # Release exceptions 

189 "ReleaseError", 

190 "ReleaserTypeError", 

191 "BundleBuildError", 

192 "SigningKeyError", 

193 "ReleaseConfigError", 

194 # Publish exceptions 

195 "PublishError", 

196 "PublisherTypeError", 

197 "PublishCliError", 

198 "PublishAuthError", 

199 "_publish_exceptions", 

200 # Installer exceptions 

201 "InstallerError", 

202 "InstallerTypeError", 

203 "IsccNotFoundError", 

204 "InstallerBuildError", 

205 "InstallerConfigError", 

206 "InstallerRenderError", 

207 # Updater exceptions 

208 "UpdaterError", 

209 "UpdaterConfigError", 

210 "UpdaterGenerationError", 

211 # Uploader exceptions 

212 "SourcePathError", 

213 "UploaderTypeError", 

214 "ServerConfigError", 

215 "BackupGenerationError", 

216 "UploadConnectionError", 

217 "UploadAuthenticationError", 

218 "UploadTimeoutError", 

219 # Validation exceptions 

220 "ValidationError", 

221 "TypeValidationError", 

222 "FormatValidationError", 

223 "RangeValidationError", 

224 "LengthValidationError", 

225 "PatternValidationError", 

226 "SchemaValidationError", 

227 "ChoiceValidationError", 

228 "RequiredFieldError", 

229 # ZIP exceptions 

230 "ZipError", 

231 "ZipCreationError", 

232 "ZipExtractionError", 

233 "ZipFileNotFoundError", 

234 "ZipFileCorruptedError", 

235 "ZipPathError", 

236 "ZipProgressError", 

237 "ZipCompressionError", 

238 # Config exceptions 

239 "ConfigError", 

240 "ConfigFieldValidationError", 

241 "ConfigFileNotFoundError", 

242 "ConfigFileParseError", 

243 "ConfigPathError", 

244 "CompilerOptionError", 

245 "OutputFolderError", 

246 "IncludeFilesError", 

247 "MissingRequiredConfigError", 

248 "TomlNotAvailableError", 

249 # Template exceptions 

250 "TemplateProcessingError", 

251 "TemplateSubstitutionError", 

252 "TemplateFileWriteError", 

253 "TemplateValidationError", 

254]