From 06738dcca00fd77930b9a0213e8dda9667780d94 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Mon, 8 May 2023 16:11:29 +0200 Subject: [PATCH] handle redis.Nil error properly Signed-off-by: Christian Richter --- v4/store/redis/redis.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v4/store/redis/redis.go b/v4/store/redis/redis.go index 4a755db9..a649fda9 100644 --- a/v4/store/redis/redis.go +++ b/v4/store/redis/redis.go @@ -3,6 +3,7 @@ package redis import ( "context" + "errors" "fmt" "time" @@ -113,6 +114,9 @@ func (r *rkv) Read(key string, opts ...store.ReadOption) ([]*store.Record, error } if len(keys) == 1 { + if errors.Is(err, redis.Nil) { + return records, store.ErrNotFound + } return records, err }