From d3fe4e6ef726ea5d98088949202ee9280d7ae017 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 14 Aug 2024 18:22:00 -0400 Subject: [PATCH] panic on not found --- mod/storage/pkg/block/store.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/storage/pkg/block/store.go b/mod/storage/pkg/block/store.go index 085084caa8..f0c9fba3f5 100644 --- a/mod/storage/pkg/block/store.go +++ b/mod/storage/pkg/block/store.go @@ -107,9 +107,12 @@ func (kv *KVStore[BeaconBlockT]) Prune(start, end uint64) error { blk, err := kv.blocks.Get(ctx, kv.nextToPrune) if err != nil { - panic(err) + if !errors.Is(err, sdkcollections.ErrNotFound) { + panic(err) + } + } else { + fmt.Println("blk", blk) } - fmt.Println("blk", blk) if err := kv.blocks.Remove(ctx, kv.nextToPrune); err != nil { // This can error for 2 reasons: