Skip to content

Commit

Permalink
pybind/cephfs: raise custom Exception with same arguments
Browse files Browse the repository at this point in the history
... 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>
  • Loading branch information
ajarr committed Jul 5, 2020
1 parent 4cd247e commit 8992489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pybind/cephfs/cephfs.pyx
Expand Up @@ -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
Expand All @@ -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',
Expand Down

0 comments on commit 8992489

Please sign in to comment.