all repos — searchix @ 7f7515906b28675a38a9988eb25f9b5b527c9d95

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: improve logging of errors in source ID handler

Alan Pearce
commit

7f7515906b28675a38a9988eb25f9b5b527c9d95

parent

075a0a4a8bfd3dba66a5fbbf88b29d525c35c8be

1 file changed, 7 insertions(+), 1 deletion(-)

changed files
M internal/index/search.gointernal/index/search.go
@@ -2,6 +2,7 @@ package index
import ( "context" + "errors" "iter" "strings" "time"
@@ -15,6 +16,7 @@
"github.com/Southclaws/fault" "github.com/Southclaws/fault/fctx" "github.com/Southclaws/fault/fmsg" + "github.com/asdine/storm/v3" "github.com/blevesearch/bleve/v2" "github.com/blevesearch/bleve/v2/search" "github.com/blevesearch/bleve/v2/search/query"
@@ -124,7 +126,11 @@ }
doc, err := index.store.GetDocument(src, id) if err != nil { - index.log.Warn("error getting document", "error", err) + if errors.Is(err, storm.ErrNotFound) { + index.log.Warn("document not found", "source", sourceName, "id", id) + } else { + index.log.Error("error getting document", "error", err) + } continue }