Skip to content

Commit

Permalink
fix(ctl): better logging in set cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
lanathlor committed Dec 6, 2024
1 parent ac4d993 commit e22990f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/ctl/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

flags "stamus-ctl/internal/handlers"
config "stamus-ctl/internal/handlers/config"
"stamus-ctl/internal/logging"

// External
"github.com/spf13/cobra"
Expand All @@ -20,7 +21,10 @@ func setCmd() *cobra.Command {
Example: set scirius.token=AwesomeToken
Or, use subcommands to set content or current configuration.`,
RunE: func(cmd *cobra.Command, args []string) error {
setHandler(cmd, args)
err := setHandler(cmd, args)
if err != nil {
logging.Sugar.Error(err)
}
return nil
},
}
Expand All @@ -45,7 +49,10 @@ func setContentCmd() *cobra.Command {
Example: config content /nginx:/etc/nginx /nginx.conf:/etc/nginx/nginx.conf,
`,
RunE: func(cmd *cobra.Command, args []string) error {
setContentHandler(cmd, args)
err := setContentHandler(cmd, args)
if err != nil {
logging.Sugar.Error(err)
}
return nil
},
}
Expand Down

0 comments on commit e22990f

Please sign in to comment.