Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Adds error handling and exit(1) if an invalid config is provided
Browse files Browse the repository at this point in the history
to pulsed
  • Loading branch information
jcooklin committed Oct 23, 2015
1 parent adbcc81 commit 091f3c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pulse.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ func action(ctx *cli.Context) {
}
cfg := control.NewConfig()
err = json.Unmarshal(b, &cfg)
if err != nil {
log.WithFields(log.Fields{
"block": "main",
"_module": "pulsed",
"error": err.Error(),
"path": config,
}).Fatal("invalid config")
os.Exit(1)
}
controlOpts = append(controlOpts, control.OptSetConfig(cfg))
}

Expand Down

0 comments on commit 091f3c6

Please sign in to comment.