lib/storage: remove logging redundant path values in a single error message

This commit is contained in:
Aliaksandr Valialkin 2022-12-03 22:13:13 -08:00
parent 93764746c2
commit 152ac564ab
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -252,7 +252,7 @@ func (bsr *blockStreamReader) readBlock() error {
if err == io.EOF { if err == io.EOF {
return io.EOF return io.EOF
} }
return fmt.Errorf("cannot read index block from index data: %w", err) return fmt.Errorf("cannot read index block: %w", err)
} }
} }
@ -354,11 +354,11 @@ func (bsr *blockStreamReader) readIndexBlock() error {
// Read index block. // Read index block.
bsr.compressedIndexData = bytesutil.ResizeNoCopyMayOverallocate(bsr.compressedIndexData, int(bsr.mr.IndexBlockSize)) bsr.compressedIndexData = bytesutil.ResizeNoCopyMayOverallocate(bsr.compressedIndexData, int(bsr.mr.IndexBlockSize))
if err := fs.ReadFullData(bsr.indexReader, bsr.compressedIndexData); err != nil { if err := fs.ReadFullData(bsr.indexReader, bsr.compressedIndexData); err != nil {
return fmt.Errorf("cannot read index block from index data at offset %d: %w", bsr.indexBlockOffset, err) return fmt.Errorf("cannot read index block at offset %d: %w", bsr.indexBlockOffset, err)
} }
tmpData, err := encoding.DecompressZSTD(bsr.indexData[:0], bsr.compressedIndexData) tmpData, err := encoding.DecompressZSTD(bsr.indexData[:0], bsr.compressedIndexData)
if err != nil { if err != nil {
return fmt.Errorf("cannot decompress index block read at offset %d: %w", bsr.indexBlockOffset, err) return fmt.Errorf("cannot decompress index block at offset %d: %w", bsr.indexBlockOffset, err)
} }
bsr.indexData = tmpData bsr.indexData = tmpData
bsr.indexCursor = bsr.indexData bsr.indexCursor = bsr.indexData