mirror of
https://github.com/ceph/ceph
synced 2025-01-11 21:50:26 +00:00
rados.py: raise specific error when write is too long
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
This commit is contained in:
parent
9983f0762d
commit
fa691dfe6c
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user