adjust error message

This commit is contained in:
Chris Lu 2019-02-18 18:03:27 -08:00
parent 2442d56671
commit d37c3ab7a5

View file

@ -14,7 +14,7 @@ func (vs *VolumeServer) VolumeSyncStatus(ctx context.Context, req *volume_server
v := vs.store.GetVolume(storage.VolumeId(req.VolumdId)) v := vs.store.GetVolume(storage.VolumeId(req.VolumdId))
if v == nil { if v == nil {
return nil, fmt.Errorf("Not Found Volume Id %d", req.VolumdId) return nil, fmt.Errorf("not found volume id %d", req.VolumdId)
} }
resp := v.GetVolumeSyncStatus() resp := v.GetVolumeSyncStatus()
@ -29,7 +29,7 @@ func (vs *VolumeServer) VolumeSyncIndex(req *volume_server_pb.VolumeSyncIndexReq
v := vs.store.GetVolume(storage.VolumeId(req.VolumdId)) v := vs.store.GetVolume(storage.VolumeId(req.VolumdId))
if v == nil { if v == nil {
return fmt.Errorf("Not Found Volume Id %d", req.VolumdId) return fmt.Errorf("not found volume id %d", req.VolumdId)
} }
content, err := v.IndexFileContent() content, err := v.IndexFileContent()
@ -59,11 +59,11 @@ func (vs *VolumeServer) VolumeSyncData(req *volume_server_pb.VolumeSyncDataReque
v := vs.store.GetVolume(storage.VolumeId(req.VolumdId)) v := vs.store.GetVolume(storage.VolumeId(req.VolumdId))
if v == nil { if v == nil {
return fmt.Errorf("Not Found Volume Id %d", req.VolumdId) return fmt.Errorf("not found volume id %d", req.VolumdId)
} }
if uint32(v.SuperBlock.CompactRevision) != req.Revision { if uint32(v.SuperBlock.CompactRevision) != req.Revision {
return fmt.Errorf("Requested Volume Revision is %d, but current revision is %d", req.Revision, v.SuperBlock.CompactRevision) return fmt.Errorf("requested volume revision is %d, but current revision is %d", req.Revision, v.SuperBlock.CompactRevision)
} }
content, err := storage.ReadNeedleBlob(v.DataFile(), int64(req.Offset)*types.NeedlePaddingSize, req.Size, v.Version()) content, err := storage.ReadNeedleBlob(v.DataFile(), int64(req.Offset)*types.NeedlePaddingSize, req.Size, v.Version())
@ -78,7 +78,7 @@ func (vs *VolumeServer) VolumeSyncData(req *volume_server_pb.VolumeSyncDataReque
n := new(storage.Needle) n := new(storage.Needle)
n.ParseNeedleHeader(content) n.ParseNeedleHeader(content)
if id != n.Id { if id != n.Id {
return fmt.Errorf("Expected file entry id %d, but found %d", id, n.Id) return fmt.Errorf("expected file entry id %d, but found %d", id, n.Id)
} }
if err != nil { if err != nil {