operations: fix call fmt.Errorf with wrong err

This commit is contained in:
alingse 2025-04-04 09:26:47 +08:00
parent 839eef0db2
commit 1c106b45ad

View File

@ -314,7 +314,7 @@ func (w *writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, r
case *bufio.Writer:
er2 := w.Flush()
if er2 != nil {
return -1, fmt.Errorf("multi-thread copy: flush failed: %w", err)
return -1, fmt.Errorf("multi-thread copy: flush failed: %w", er2)
}
}
return n, nil