From: Ramana Raja Date: Sun, 5 Jul 2020 11:46:15 +0000 (+0530) Subject: pybind/cephfs: raise custom Exception with same arguments X-Git-Tag: v16.1.0~1794^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35934%2Fhead;p=ceph.git pybind/cephfs: raise custom Exception with same arguments ... so that's easier for a higher level application to handle it. Fixes: https://tracker.ceph.com/issues/46360 Signed-off-by: Ramana Raja --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 05f93a8dfd1f..47df4992d7b4 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -357,7 +357,7 @@ ELSE: cdef make_ex(ret, msg): """ - Translate a librados return code into an exception. + Translate a libcephfs return code into an exception. :param ret: the return code :type ret: int @@ -369,7 +369,7 @@ cdef make_ex(ret, msg): if ret in errno_to_exception: return errno_to_exception[ret](ret, msg) else: - return Error(msg + ': {} [Errno {:d}]'.format(os.strerror(ret), ret)) + return OSError(ret, msg) class DirEntry(namedtuple('DirEntry',