From: Josh Durgin Date: Wed, 21 Sep 2011 00:24:24 +0000 (-0700) Subject: rados.py: raise specific error when write is too long X-Git-Tag: v0.37~151 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fa691dfe6ccf20b8e869cd2384d92cdb8fd4fe50;p=ceph.git rados.py: raise specific error when write is too long Signed-off-by: Josh Durgin --- diff --git a/src/pybind/rados.py b/src/pybind/rados.py index 32c49db71f83f..bc2ce185252d3 100755 --- a/src/pybind/rados.py +++ b/src/pybind/rados.py @@ -47,6 +47,9 @@ class IoctxStateError(Exception): class ObjectStateError(Exception): pass +class LogicError(Exception): + pass + def make_ex(ret, msg): ret = abs(ret) if (ret == errno.EPERM): @@ -361,7 +364,7 @@ class Ioctx(object): raise IncompleteWriteError("Wrote only %ld out of %ld bytes" % \ (ret, length)) else: - raise make_ex("Ioctx.write(%s): logic error: rados_write \ + raise LogicError("Ioctx.write(%s): rados_write \ returned %d, but %d was the maximum number of bytes it could have \ written." % (self.name, ret, length))