From 441534051db19afd8e25c16cd5d953d6810aedf5 Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Thu, 5 Dec 2024 12:31:26 -0500 Subject: [PATCH 1/2] panic on index error --- explorer/explorer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/explorer/explorer.go b/explorer/explorer.go index 672d2b73..e0293dc1 100644 --- a/explorer/explorer.go +++ b/explorer/explorer.go @@ -139,6 +139,7 @@ func NewExplorer(cm ChainManager, store Store, batchSize int, scanCfg config.Sca } if err := e.syncStore(lastTip, batchSize); err != nil { e.log.Error("failed to sync store", zap.Error(err)) + panic(err) } } }() From c56345e5bf6bd87e5f332f4b941c897c1e9e77d1 Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Thu, 5 Dec 2024 16:39:10 -0500 Subject: [PATCH 2/2] use logger's panic function --- explorer/explorer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/explorer/explorer.go b/explorer/explorer.go index e0293dc1..9425b34c 100644 --- a/explorer/explorer.go +++ b/explorer/explorer.go @@ -138,8 +138,7 @@ func NewExplorer(cm ChainManager, store Store, batchSize int, scanCfg config.Sca e.log.Error("failed to get tip", zap.Error(err)) } if err := e.syncStore(lastTip, batchSize); err != nil { - e.log.Error("failed to sync store", zap.Error(err)) - panic(err) + e.log.Panic("failed to sync store", zap.Error(err)) } } }()