diff options
| author | historia <[not public]> | 2026-09-18 01:50:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 01:50:17 -0400 |
| commit | 87d08f0151e643951769e323995f1c5ed89ee200 (patch) | |
| tree | dc42a0b30ebb5a00dd7ba505cc4eaa44f4f308bc /internal/cardart | |
| parent | 32a3c59cebf2a16277e54d715a67adfdbe00b456 (diff) | |
| download | thehouseoficarus-87d08f0151e643951769e323995f1c5ed89ee200.tar.gz | |
fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths
Diffstat (limited to 'internal/cardart')
| -rw-r--r-- | internal/cardart/store.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/cardart/store.go b/internal/cardart/store.go index 7e9b263..1a3621f 100644 --- a/internal/cardart/store.go +++ b/internal/cardart/store.go @@ -3,6 +3,7 @@ package cardart import ( + "fmt" "os" "gopkg.in/yaml.v3" @@ -15,9 +16,15 @@ type Store struct { func Load(path string) *Store { store := &Store{Cards: make(map[string]map[int][]string)} data, err := os.ReadFile(path) - if err != nil || yaml.Unmarshal(data, store) != nil { + if err != nil { + if !os.IsNotExist(err) { + fmt.Fprintf(os.Stderr, "cardart: read %s: %v\n", path, err) + } return store } + if err := yaml.Unmarshal(data, store); err != nil { + fmt.Fprintf(os.Stderr, "cardart: parse %s: %v\n", path, err) + } return store } |
