Skip to content

Commit ba67ad3

Browse files
committed
[core] Improve error reporting when loading configuration
1 parent 16d7f1f commit ba67ad3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

core/state.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,16 @@ func newInternalState(cfg Config, shutdown func()) (*internalState, error) {
6363

6464
cfgman, err := configuration.NewConfiguration(cfg.configurationUri)
6565
if cfg.veryVerbose {
66-
cfgDump, _ := cfgman.GetRecursive("o2/control")
67-
cfgBytes, _ := json.MarshalIndent(cfgDump,"", "\t")
66+
cfgDump, err := cfgman.GetRecursive("o2/control")
67+
if err != nil {
68+
log.WithError(err).Fatal("cannot retrieve configuration")
69+
return nil, err
70+
}
71+
cfgBytes, err := json.MarshalIndent(cfgDump,"", "\t")
72+
if err != nil {
73+
log.WithError(err).Fatal("cannot marshal configuration dump")
74+
return nil, err
75+
}
6876
log.WithField("data", string(cfgBytes)).Debug("configuration dump")
6977
}
7078
if err != nil {

0 commit comments

Comments
 (0)