]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/volumes/fs/exception.py
import ceph 15.2.10
[ceph.git] / ceph / src / pybind / mgr / volumes / fs / exception.py
1 class VolumeException(Exception):
2 def __init__(self, error_code, error_message):
3 self.errno = error_code
4 self.error_str = error_message
5
6 def to_tuple(self):
7 return self.errno, "", self.error_str
8
9 def __str__(self):
10 return "{0} ({1})".format(self.errno, self.error_str)
11
12 class MetadataMgrException(Exception):
13 def __init__(self, error_code, error_message):
14 self.errno = error_code
15 self.error_str = error_message
16
17 def __str__(self):
18 return "{0} ({1})".format(self.errno, self.error_str)
19
20 class IndexException(Exception):
21 def __init__(self, error_code, error_message):
22 self.errno = error_code
23 self.error_str = error_message
24
25 def __str__(self):
26 return "{0} ({1})".format(self.errno, self.error_str)
27
28 class OpSmException(Exception):
29 def __init__(self, error_code, error_message):
30 self.errno = error_code
31 self.error_str = error_message
32
33 def __str__(self):
34 return "{0} ({1})".format(self.errno, self.error_str)
35
36 class NotImplementedException(Exception):
37 pass
38
39 class ClusterTimeout(Exception):
40 """
41 Exception indicating that we timed out trying to talk to the Ceph cluster,
42 either to the mons, or to any individual daemon that the mons indicate ought
43 to be up but isn't responding to us.
44 """
45 pass
46
47 class ClusterError(Exception):
48 """
49 Exception indicating that the cluster returned an error to a command that
50 we thought should be successful based on our last knowledge of the cluster
51 state.
52 """
53 def __init__(self, action, result_code, result_str):
54 self._action = action
55 self._result_code = result_code
56 self._result_str = result_str
57
58 def __str__(self):
59 return "Error {0} (\"{1}\") while {2}".format(
60 self._result_code, self._result_str, self._action)
61
62 class EvictionError(Exception):
63 pass