]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/cephfs: raise custom Exception with same arguments 35934/head
authorRamana Raja <rraja@redhat.com>
Sun, 5 Jul 2020 11:46:15 +0000 (17:16 +0530)
committerRamana Raja <rraja@redhat.com>
Sun, 5 Jul 2020 11:56:49 +0000 (17:26 +0530)
... so that's easier for a higher level application to handle
it.

Fixes: https://tracker.ceph.com/issues/46360
Signed-off-by: Ramana Raja <rraja@redhat.com>
src/pybind/cephfs/cephfs.pyx

index 05f93a8dfd1f8d5c7f57448fae4fbc5b64908c87..47df4992d7b4107663b4c4c9932f4f9f68e7485a 100644 (file)
@@ -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',