Coverage for /Users/buh/.pyenv/versions/3.12.9/envs/es-testbed/lib/python3.12/site-packages/es_testbed/exceptions.py: 100%
20 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-04-17 22:23 -0600
« prev ^ index » next coverage.py v7.6.12, created at 2025-04-17 22:23 -0600
1"""es-testbed Exceptions"""
3from typing import Any, Tuple
6class TestbedException(Exception): # parent exception
7 """
8 Base class for all exceptions raised by the tool which are not Elasticsearch
9 or es_client exceptions.
11 For the 'errors' attribute, errors are ordered from
12 most recently raised (index=0) to least recently raised (index=N)
13 """
15 __test__ = False
17 def __init__(self, message: Any, errors: Tuple[Exception, ...] = ()):
18 super().__init__(message)
19 self.message = message
20 self.errors = tuple(errors)
22 def __repr__(self) -> str:
23 parts = [repr(self.message)]
24 if self.errors:
25 parts.append(f"errors={self.errors!r}")
26 return f'{self.__class__.__name__}({", ".join(parts)})'
28 def __str__(self) -> str:
29 return str(self.message)
32class MissingArgument(TestbedException):
33 """
34 An expected argument was missing
35 """
38class NameChanged(TestbedException):
39 """
40 An index name changed, likely due to an ILM promotion to cold or frozen
41 """
44class StepChanged(TestbedException):
45 """
46 The current step changed since the initial API call was formed
47 """
50class ResultNotExpected(TestbedException):
51 """
52 The result we got is not what we expected
53 """
56class TestbedFailure(TestbedException):
57 """
58 Whatever we were trying to do failed.
59 """
61 __test__ = False
64class TestbedMisconfig(TestbedException):
65 """
66 There was a misconfiguration encountered.
67 """
69 __test__ = False
72class TestPlanMisconfig(TestbedMisconfig):
73 """
74 There was a misconfiguration in a TestPlan.
75 """
77 __test__ = False
80class TimeoutException(TestbedException):
81 """
82 An process took too long to complete
83 """