Coverage for src/es_fieldusage/exceptions.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-03-26 17:48 -0600

1"""es-fieldusage Exceptions""" 

2 

3# Parent exception 

4 

5 

6class FieldUsageException(Exception): 

7 """ 

8 Base class for all exceptions raised by the tool which are not Elasticsearch 

9 exceptions. 

10 """ 

11 

12 

13# Child exceptions 

14 

15 

16class ClientException(FieldUsageException): 

17 """ 

18 Exception raised when the Elasticsearch client and/or connection is the 

19 source of the problem. 

20 """ 

21 

22 

23class ConfigurationException(FieldUsageException): 

24 """ 

25 Exception raised when there is a configuration error 

26 """ 

27 

28 

29class MissingArgument(ConfigurationException): 

30 """ 

31 Exception raised when a required argument or parameter is missing 

32 """ 

33 

34 

35class ResultNotExpected(ClientException): 

36 """ 

37 Exception raised when return value from Elasticsearch API call is not or does 

38 not contain the expected result. 

39 """ 

40 

41 

42class TimeoutException(FieldUsageException): 

43 """ 

44 Exception raised when a task has failed because the allotted time ran out 

45 """ 

46 

47 

48class ValueMismatch(ConfigurationException): 

49 """ 

50 Exception raised when a received value does not match what was expected. 

51 """ 

52 

53 

54class FatalException(FieldUsageException): 

55 """ 

56 Exception raised when the program should be halted. 

57 """