Coverage for src / mafw / mafw_errors.py: 100%

31 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-09 09:08 +0000

1# Copyright 2025 European Union 

2# Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu) 

3# SPDX-License-Identifier: EUPL-1.2 

4""" 

5Module defines MAFw exceptions 

6""" 

7 

8 

9class MAFwException(Exception): 

10 """Base class for MAFwException""" 

11 

12 pass 

13 

14 

15class ProcessorParameterError(MAFwException): 

16 """Error with a processor parameter""" 

17 

18 pass 

19 

20 

21class InvalidConfigurationError(MAFwException): 

22 """Error with the configuration of a processor""" 

23 

24 pass 

25 

26 

27class MissingOverloadedMethod(UserWarning): 

28 """ 

29 Warning issued when the user did not overload a required method. 

30 

31 It is a warning and not an error because the execution framework might still work, but the results might be 

32 different from what is expected. 

33 """ 

34 

35 pass 

36 

37 

38class MissingSuperCall(UserWarning): 

39 """ 

40 Warning issued when the user did not invoke the super method for some specific processor methods. 

41 

42 Those methods (like :meth:`~mafw.processor.Processor.start` and :meth:`~mafw.processor.Processor.finish`) have not 

43 empty implementation also in the base class, meaning that if the user forgets to call *super* in their overloads, 

44 then the basic implementation will be gone. 

45 

46 It is a warning and not an error because the execution framework might sill work, but the results might be 

47 different from what is expected. 

48 """ 

49 

50 pass 

51 

52 

53class AbortProcessorException(MAFwException): 

54 """Exception raised during the execution of a processor requiring immediate exit.""" 

55 

56 pass 

57 

58 

59class RunnerNotInitialized(MAFwException): 

60 """Exception raised when attempting to run a not initialized Runner.""" 

61 

62 pass 

63 

64 

65class InvalidSteeringFile(MAFwException): 

66 """Exception raised when validating an invalid steering file""" 

67 

68 pass 

69 

70 

71class UnknownProcessor(MAFwException): 

72 """Exception raised when an attempt is made to create an unknown processor""" 

73 

74 pass 

75 

76 

77class UnknownProcessorGroup(MAFwException): 

78 """Exception raised when an attempt is made to create an unknown processor group""" 

79 

80 pass 

81 

82 

83class UnknownDBEngine(MAFwException): 

84 """Exception raised when the user provided an unknown db engine""" 

85 

86 pass 

87 

88 

89class MissingDatabase(MAFwException): 

90 """Exception raised when a processor requiring a database connection is being operated without a database""" 

91 

92 

93class MissingAttribute(MAFwException): 

94 """Exception raised when an attempt is made to execute a statement without a required parameter/attributes""" 

95 

96 

97class ParserConfigurationError(MAFwException): 

98 """Exception raised when an error occurred during the configuration of a filename parser""" 

99 

100 

101class ParsingError(MAFwException): 

102 """Exception raised when a regular expression parsing failed""" 

103 

104 

105class MissingSQLStatement(MAFwException): 

106 """Exception raised when a Trigger is created without any SQL statements.""" 

107 

108 

109class UnsupportedDatabaseError(Exception): 

110 """Error raised when a feature is not supported by the database.""" 

111 

112 

113class ModelError(MAFwException): 

114 """Exception raised when an error in a DB Model class occurs""" 

115 

116 

117class MissingOptionalDependency(UserWarning): 

118 """UserWarning raised when an optional dependency is required""" 

119 

120 

121class PlotterMixinNotInitialized(MAFwException): 

122 """Exception raised when a plotter mixin has not properly initialized"""