Check specific db error

This commit is contained in:
Alfred Kamanda 2024-10-23 14:02:13 +03:00
parent 176473aa26
commit 4011597d9c
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -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)