Skip to content

Commit

Permalink
Minimally addresses naggie#71: don't swallow errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxserxxx committed Aug 10, 2022
1 parent 5adadaf commit 8146b60
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ var (
Run: func(cmd *cobra.Command, args []string) {
config := cli.MustLoadConfigFile()
server := cli.GetServer(config)
server.Up()
utils.ShellOut(config.PostUp, "PostUp")
if e := server.Up(); e != nil {
fmt.Printf("error bringing up the network: %s\n", e)
}
if e := utils.ShellOut(config.PostUp, "PostUp"); e != nil {
fmt.Printf("error bringing up the network: %s\n", e)
}
},
}

Expand All @@ -50,8 +54,12 @@ var (
Run: func(cmd *cobra.Command, args []string) {
config := cli.MustLoadConfigFile()
server := cli.GetServer(config)
server.DeleteLink()
utils.ShellOut(config.PostDown, "PostDown")
if e := server.DeleteLink(); e != nil {
fmt.Printf("error bringing up the network: %s\n", e)
}
if e := utils.ShellOut(config.PostDown, "PostDown"); e != nil {
fmt.Printf("error bringing up the network: %s\n", e)
}
},
}

Expand Down

0 comments on commit 8146b60

Please # to comment.