From 19e747f1669d8ae64619686569929a59d5722b8c Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 13 Jan 2021 15:38:19 +0100 Subject: Finished implementing config tests --- config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config/config.go') 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 -- cgit v1.2.3