only skip invalid json manifests

This commit is contained in:
Michael Yang 2024-08-15 10:29:14 -07:00
parent 237dccba1e
commit 3a75e74e34

View file

@ -5,6 +5,7 @@ import (
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"io" "io"
"log/slog" "log/slog"
"os" "os"
@ -155,9 +156,11 @@ func Manifests() (map[model.Name]*Manifest, error) {
} }
m, err := ParseNamedManifest(n) m, err := ParseNamedManifest(n)
if err != nil { if syntax := &(json.SyntaxError{}); errors.As(err, &syntax) {
slog.Warn("bad manifest", "name", n, "error", err) slog.Warn("bad manifest", "name", n, "error", err)
continue continue
} else if err != nil {
return nil, fmt.Errorf("%s: %w", n, err)
} }
ms[n] = m ms[n] = m