fix(ingestion): wrap naked error returns and harden mustJSON helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-22 22:51:19 +02:00
parent 103f4d90bf
commit 04fefe8e9c
3 changed files with 10 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package wiki
import (
"bufio"
"fmt"
"os"
"path/filepath"
"strings"
@@ -23,7 +24,7 @@ func LoadInventory(brainDir string) (map[PageType][]Entry, error) {
continue
}
if err != nil {
return nil, err
return nil, fmt.Errorf("read dir %s: %w", dir, err)
}
for _, e := range entries {
if e.IsDir() || !strings.HasSuffix(e.Name(), ".md") {