Coverage for src/ezcompiler/shared/exceptions/services/_service_exceptions.py: 100.00%

13 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-07-04 11:22 +0000

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

2# SERVICE_EXCEPTIONS - Service layer exceptions 

3# Project: ezcompiler 

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

5 

6""" 

7Service exceptions - Specialized exceptions for service layer operations. 

8 

9This module defines exceptions for the business logic layer (services). 

10Each service has a base exception with specific error scenarios. 

11Granularity is limited to essential error categories to avoid exception overload. 

12""" 

13 

14from __future__ import annotations 

15 

16# /////////////////////////////////////////////////////////////// 

17# IMPORTS 

18# /////////////////////////////////////////////////////////////// 

19from ..utils._release_exceptions import ReleaseError 

20from ..utils._updater_exceptions import UpdaterError 

21from ..utils._uploader_exceptions import UploadError 

22from ._base import EzCompilerServiceError 

23 

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

25# EXCEPTIONS - COMPILER SERVICE 

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

27 

28 

29class CompilerServiceError(EzCompilerServiceError): 

30 """Base exception for compiler service operations.""" 

31 

32 

33class CompilationError(CompilerServiceError): 

34 """Raised when project compilation fails.""" 

35 

36 

37class ConfigurationError(CompilerServiceError): 

38 """Raised when configuration is invalid or missing.""" 

39 

40 

41# /////////////////////////////////////////////////////////////// 

42# EXCEPTIONS - TEMPLATE SERVICE 

43# /////////////////////////////////////////////////////////////// 

44 

45 

46class TemplateServiceError(EzCompilerServiceError): 

47 """Base exception for template service operations.""" 

48 

49 

50class TemplateError(TemplateServiceError): 

51 """Raised when template processing or file generation fails.""" 

52 

53 

54class VersionError(TemplateServiceError): 

55 """Raised when version file generation fails.""" 

56 

57 

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

59# EXCEPTIONS - UPLOADER SERVICE 

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

61 

62 

63class UploaderServiceError(EzCompilerServiceError): 

64 """Base exception for uploader service operations. 

65 

66 Conservé pour compatibilité ; `UploadError` est désormais l'unique classe 

67 canonique importée depuis utils/_uploader_exceptions.py (sous EzCompilerError). 

68 """ 

69 

70 

71# UploadError est ré-exporté ici (importé ci-dessus) pour préserver l'API publique 

72# `from ..shared.exceptions import UploadError` sans dupliquer la classe. 

73__all__ = [ 

74 "CompilerServiceError", 

75 "CompilationError", 

76 "ConfigurationError", 

77 "TemplateServiceError", 

78 "TemplateError", 

79 "VersionError", 

80 "UploaderServiceError", 

81 "UploadError", 

82 "ReleaseError", 

83 "UpdaterError", 

84]