Harden storage store initialization
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

This commit is contained in:
Snider 2026-04-17 19:05:15 +01:00
parent 345afb16bb
commit f1ccbf4270

View file

@ -52,11 +52,23 @@ func openStorageStore() *gostore.Store {
}
if path != ":memory:" {
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
core.Error(
"storage registry init failed",
"path", path,
"step", "mkdir",
"err", core.E("display.storage.open", "failed to create storage directory", err),
)
return nil
}
}
storeInstance, err := gostore.New(path)
if err != nil {
core.Error(
"storage registry init failed",
"path", path,
"step", "open",
"err", core.E("display.storage.open", "failed to open storage store", err),
)
return nil
}
return storeInstance