From b4d5ebf51d05288f8f97dcae20fde0af6513d16a 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 (cherry picked from commit 8992489cab6c0d09244c0640c6ec1a0e0f486b5a) --- 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 751c2ed9fb6..7d8cabd004c 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -298,7 +298,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 @@ -310,7 +310,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