]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/nfs/exception.py
2 from typing
import Optional
5 class NFSException(Exception):
6 def __init__(self
, err_msg
: str, errno
: int = -1) -> None:
7 super(NFSException
, self
).__init
__(errno
, err_msg
)
11 def __str__(self
) -> str:
15 class NFSInvalidOperation(NFSException
):
16 def __init__(self
, err_msg
: str) -> None:
17 super(NFSInvalidOperation
, self
).__init
__(err_msg
, -errno
.EINVAL
)
20 class NFSObjectNotFound(NFSException
):
21 def __init__(self
, err_msg
: str) -> None:
22 super(NFSObjectNotFound
, self
).__init
__(err_msg
, -errno
.ENOENT
)
25 class FSNotFound(NFSObjectNotFound
):
26 def __init__(self
, fs_name
: Optional
[str]) -> None:
27 super(FSNotFound
, self
).__init
__(f
'filesystem {fs_name} not found')
30 class ClusterNotFound(NFSObjectNotFound
):
31 def __init__(self
) -> None:
32 super(ClusterNotFound
, self
).__init
__('cluster does not exist')