From 4011597d9c9d6653c35cb569970aba62066b59e9 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 23 Oct 2024 14:02:13 +0300 Subject: [PATCH] Check specific db error --- internal/handlers/ussd/menuhandler.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index d464ca3..009d3cc 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -640,8 +640,12 @@ func (h *Handlers) CheckBalance(ctx context.Context, sym string, input []byte) ( // get the active sym and active balance activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM) if err != nil { - res.Content = "0.00" - return res, nil + if db.IsNotFound(err) { + res.Content = "0.00" + return res, nil + } + + return res, err } activeBal, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_BAL)