From 3c013931189c3d995a4cbdfab8550ba140d45373 Mon Sep 17 00:00:00 2001 From: pippellia-btc Date: Mon, 16 Jun 2025 13:43:16 +0200 Subject: [PATCH] correctl wrapping redis nil error --- pkg/redb/graph.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/redb/graph.go b/pkg/redb/graph.go index 74f3d69..16b893e 100644 --- a/pkg/redb/graph.go +++ b/pkg/redb/graph.go @@ -115,6 +115,9 @@ func (db RedisDB) NodeByID(ctx context.Context, ID graph.ID) (*graph.Node, error func (db RedisDB) NodeByKey(ctx context.Context, pubkey string) (*graph.Node, error) { ID, err := db.Client.HGet(ctx, KeyKeyIndex, pubkey).Result() if err != nil { + if errors.Is(err, redis.Nil) { + err = graph.ErrNodeNotFound + } return nil, fmt.Errorf("failed to fetch ID of node with pubkey %s: %w", pubkey, err) }