Skip to content

Commit

Permalink
fix: report config file errors on startup #75
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-cooke authored Oct 28, 2024
1 parent 831d266 commit afa2007
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ func readConfig(configFilePath string) {
fmt.Printf("FILES: \n log: %s\n lock: %s\n cache: %s\n config: %s\n\n", Args.Log, Args.Lock, Args.Cache, configFilePath)

// Decode config file into struct
toml.DecodeFile(configFilePath, &Config)
_, err := toml.DecodeFile(configFilePath, &Config)
if err != nil {
log.
WithFields(log.Fields{"File": configFilePath}).
Fatal("Error reading config file: ", err)
}

// Print shortcut infos
keys, _ := json.MarshalIndent(Config.Keys, "", " ")
Expand Down

0 comments on commit afa2007

Please sign in to comment.