aboutsummaryrefslogtreecommitdiff
path: root/internal/cardart/store.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 01:50:17 -0400
committerhistoria <[not public]>2026-09-18 01:50:17 -0400
commit87d08f0151e643951769e323995f1c5ed89ee200 (patch)
treedc42a0b30ebb5a00dd7ba505cc4eaa44f4f308bc /internal/cardart/store.go
parent32a3c59cebf2a16277e54d715a67adfdbe00b456 (diff)
downloadthehouseoficarus-87d08f0151e643951769e323995f1c5ed89ee200.tar.gz
fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths
Diffstat (limited to 'internal/cardart/store.go')
-rw-r--r--internal/cardart/store.go9
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
}