aboutsummaryrefslogtreecommitdiff
path: root/config/config.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-01-13 15:38:19 +0100
committerJulien Dessaux2021-01-13 15:38:19 +0100
commit19e747f1669d8ae64619686569929a59d5722b8c (patch)
tree370b8742f7563e1b750f5ad494e654a7fcc24838 /config/config.go
parentProperly test the minimal config contents (diff)
downloadshell-game-launcher-19e747f1669d8ae64619686569929a59d5722b8c.tar.gz
shell-game-launcher-19e747f1669d8ae64619686569929a59d5722b8c.tar.bz2
shell-game-launcher-19e747f1669d8ae64619686569929a59d5722b8c.zip
Finished implementing config tests
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go
index aa1672a..9a161ed 100644
--- a/config/config.go
+++ b/config/config.go
@@ -44,20 +44,20 @@ func LoadFile(path string) (config Config, err error) {
var f *os.File
f, err = os.Open(path)
if err != nil {
- return
+ return config, errors.Wrapf(err, "Failed to open configuration file %s", path)
}
defer f.Close()
decoder := yaml.NewDecoder(f)
if err = decoder.Decode(&config); err != nil {
- return
+ return config, errors.Wrap(err, "Failed to decode configuration file")
}
if err = config.validate(); err != nil {
- return
+ return config, errors.Wrap(err, "Failed to validate configuration")
}
// If all looks good we validate menu consistency
for _, v := range config.Menus {
if err = v.validateConsistency(&config); err != nil {
- return
+ return config, errors.Wrap(err, "Failed menu consistency checks")
}
}
return