add missing proper error return in WalkDir() (#18884)

without this the caller might end up returning
incorrect errors and not ignoring the drive
properly.
This commit is contained in:
Harshavardhana
2024-01-27 16:13:41 -08:00
committed by GitHub
parent 32e668eb94
commit 6347fb6636
2 changed files with 14 additions and 2 deletions

View File

@@ -407,12 +407,12 @@ func (client *storageRESTClient) WalkDir(ctx context.Context, opts WalkDirOption
opts.DiskID = client.diskID
b, err := opts.MarshalMsg(grid.GetByteBuffer()[:0])
if err != nil {
return err
return toStorageErr(err)
}
st, err := client.gridConn.NewStream(ctx, grid.HandlerWalkDir, b)
if err != nil {
return err
return toStorageErr(err)
}
return toStorageErr(st.Results(func(in []byte) error {
_, err := wr.Write(in)