]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind: store errno in Error exception also 14497/head
authorKefu Chai <kchai@redhat.com>
Thu, 13 Apr 2017 07:26:14 +0000 (15:26 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 20 Apr 2017 08:32:06 +0000 (16:32 +0800)
commitac580718e949dee1def9566a4cd16d0a3d1b6986
treeb6f8f378460a8f53df109ce83bbb9e52b6552855
parent801c5c4e26a63c9d4f9e3170377922ef8e147275
pybind: store errno in Error exception also

also pass the errno and error string to Exception's __init__()
so we can print them all using str(err). otherwise str(err) will only
print out the errorstr, and the type information is lost. for example,
if ping_monitor() raises an exception, all we get is an error of:

  error calling ping_monitor

which is barely helpful. after this change:

  [Errno 22] error calling ping_monitor

is printed instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/cephfs/cephfs.pyx
src/pybind/rados/rados.pyx
src/pybind/rbd/rbd.pyx
src/pybind/rgw/rgw.pyx