fix error reporting

related to https://github.com/seaweedfs/seaweedfs/issues/4978
This commit is contained in:
chrislu 2023-11-05 07:17:16 -08:00
parent b40ba7c7fe
commit a667f0ad99

View file

@ -49,7 +49,7 @@ func (vs *VolumeServer) FetchAndWriteNeedle(ctx context.Context, req *volume_ser
n.SetHasLastModifiedDate()
if _, localWriteErr := vs.store.WriteVolumeNeedle(v.Id, n, true, false); localWriteErr != nil {
if err == nil {
err = fmt.Errorf("local write needle %d size %d: %v", req.NeedleId, req.Size, err)
err = fmt.Errorf("local write needle %d size %d: %v", req.NeedleId, req.Size, localWriteErr)
}
} else {
resp.ETag = n.Etag()