diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-22 23:27:53 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-08-22 23:27:53 -0500 |
commit | 24548e87decbdfea38bbf692cecad6d4eefc3ec0 (patch) | |
tree | 4f5d1432d1e22a1f19ceabbc92dcdd86bed98017 /fs.go | |
parent | 5d33040ab80b5cce7883b2e5965aa17db2e6515a (diff) | |
download | deb-planr-24548e87decbdfea38bbf692cecad6d4eefc3ec0.tar.xz deb-planr-24548e87decbdfea38bbf692cecad6d4eefc3ec0.zip |
Refactoring & Enhanced logging
Diffstat (limited to 'fs.go')
-rw-r--r-- | fs.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -208,11 +208,15 @@ func collectFromDir( // Process defaults for this directory if a defaults.toml is found defaultsPath := path.Join(dir, DEFAULTS) if info, err := os.Stat(defaultsPath); err == nil && !info.IsDir() { - d := DecodeDefaults(defaultsPath, cfgs) + d, err := DecodeDefaults(defaultsPath, cfgs) + + if err != nil { + log.Fatalf("Error encounter in %s: %v\n", defaultsPath, err); + } // inherit the properties not defined in this defaults if defaults != nil { - d.Inherit(defaults) + d.Inherit(*defaults) } defaults = &d @@ -240,7 +244,12 @@ func collectFromDir( } // Decode a unit - config := DecodeConfig(child, cfgs) + config, err := DecodeConfig(child, cfgs) + + if err != nil { + log.Fatalf("Error encountered in %s: %v", child, config) + } + config.Inherit(*defaults) tc := TestCase { |