Properly wrap errors in readerat helper

This commit is contained in:
Michael Eischer 2021-05-15 23:11:48 +02:00
parent 75c990504d
commit cf92c58460
1 changed files with 2 additions and 3 deletions

View File

@ -35,10 +35,9 @@ func ReadAt(ctx context.Context, be Backend, h Handle, offset int64, p []byte) (
return ierr
})
if err != nil {
return 0, err
return 0, errors.Wrapf(err, "ReadFull(%v)", h)
}
debug.Log("ReadAt(%v) ReadFull returned %v bytes", h, n)
return n, errors.Wrapf(err, "ReadFull(%v)", h)
return n, nil
}