1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-01-03 05:35:43 +00:00

restorer: Check dropped error

This commit is contained in:
Michael Eischer 2021-01-31 18:04:45 +01:00
parent b3dc127af5
commit 47faf69230

View file

@ -205,12 +205,16 @@ func (r *fileRestorer) downloadPack(ctx context.Context, pack *packInfo) error {
} }
if fileBlobs, ok := file.blobs.(restic.IDs); ok { if fileBlobs, ok := file.blobs.(restic.IDs); ok {
fileOffset := int64(0) fileOffset := int64(0)
r.forEachBlob(fileBlobs, func(packID restic.ID, blob restic.Blob) { err := r.forEachBlob(fileBlobs, func(packID restic.ID, blob restic.Blob) {
if packID.Equal(pack.id) { if packID.Equal(pack.id) {
addBlob(blob, fileOffset) addBlob(blob, fileOffset)
} }
fileOffset += int64(blob.Length) - crypto.Extension fileOffset += int64(blob.Length) - crypto.Extension
}) })
if err != nil {
// restoreFiles should have caught this error before
panic(err)
}
} else if packsMap, ok := file.blobs.(map[restic.ID][]fileBlobInfo); ok { } else if packsMap, ok := file.blobs.(map[restic.ID][]fileBlobInfo); ok {
for _, blob := range packsMap[pack.id] { for _, blob := range packsMap[pack.id] {
idxPacks := r.idx(restic.BlobHandle{ID: blob.id, Type: restic.DataBlob}) idxPacks := r.idx(restic.BlobHandle{ID: blob.id, Type: restic.DataBlob})