diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-02 14:38:49 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-02 14:38:49 +0200 |
| commit | 36c332b4a3deef68c93232416c68ec2b74f108fb (patch) | |
| tree | e16cae69d568d17ecf6995e6c90f94580e0a5cd2 /internal | |
| parent | b0ccc1890234b2505dbc905a70b028ee2e666ce9 (diff) | |
appconfig: return toml raw-unmarshal errors instead of ignoring (task 409)
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/appconfig/config_load.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/appconfig/config_load.go b/internal/appconfig/config_load.go index 79f77c7..261835b 100644 --- a/internal/appconfig/config_load.go +++ b/internal/appconfig/config_load.go @@ -152,13 +152,19 @@ func loadFromFile(path string, logger *log.Logger) (*App, error) { errTables := toml.NewDecoder(strings.NewReader(string(b))).Decode(&tables) // Raw map for validation/presence checks var raw map[string]any - _ = toml.Unmarshal(b, &raw) + errRaw := toml.Unmarshal(b, &raw) if errTables != nil { if logger != nil { logger.Printf("invalid TOML config file %s: %v", path, errTables) } return nil, errTables } + if errRaw != nil { + if logger != nil { + logger.Printf("invalid TOML config file %s: %v", path, errRaw) + } + return nil, errRaw + } // Reject legacy flat keys at top-level (sectioned-only config is allowed) legacy := map[string]struct{}{ |
