ioctx: check high-level error first

the problem was that the C-API was returning an error, but the error
pointer (from the op) was getting -EIO. That makes sense as the outer
error was resulting in junk being decode somewhere.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
Noah Watkins 2017-01-20 09:36:07 -08:00
parent a1c7418732
commit 022d69c468
1 changed files with 3 additions and 3 deletions

View File

@ -444,10 +444,10 @@ func (ioctx *IOContext) ListOmapValues(oid string, startAfter string, filterPref
ret := C.rados_read_op_operate(op, ioctx.ioctx, c_oid, 0) ret := C.rados_read_op_operate(op, ioctx.ioctx, c_oid, 0)
if int(c_prval) != 0 { if int(ret) != 0 {
return RadosError(int(c_prval))
} else if int(ret) != 0 {
return GetRadosError(int(ret)) return GetRadosError(int(ret))
} else if int(c_prval) != 0 {
return RadosError(int(c_prval))
} }
for { for {