]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados.py: raise specific error when write is too long
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 21 Sep 2011 00:24:24 +0000 (17:24 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 27 Sep 2011 01:10:39 +0000 (18:10 -0700)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/pybind/rados.py

index 32c49db71f83fc086a512093b1fb1da607036510..bc2ce185252d31c80c1f85f914797d2189992baf 100755 (executable)
@@ -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))