From 8992489cab6c0d09244c0640c6ec1a0e0f486b5a Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Sun, 5 Jul 2020 17:16:15 +0530 Subject: [PATCH] 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 --- src/pybind/cephfs/cephfs.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 05f93a8dfd1..47df4992d7b 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', -- 2.47.3