Skip to content

Commit e22990f

Browse files
committed
fix(ctl): better logging in set cmd
1 parent ac4d993 commit e22990f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmd/ctl/config/set.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
flags "stamus-ctl/internal/handlers"
77
config "stamus-ctl/internal/handlers/config"
8+
"stamus-ctl/internal/logging"
89

910
// External
1011
"github.com/spf13/cobra"
@@ -20,7 +21,10 @@ func setCmd() *cobra.Command {
2021
Example: set scirius.token=AwesomeToken
2122
Or, use subcommands to set content or current configuration.`,
2223
RunE: func(cmd *cobra.Command, args []string) error {
23-
setHandler(cmd, args)
24+
err := setHandler(cmd, args)
25+
if err != nil {
26+
logging.Sugar.Error(err)
27+
}
2428
return nil
2529
},
2630
}
@@ -45,7 +49,10 @@ func setContentCmd() *cobra.Command {
4549
Example: config content /nginx:/etc/nginx /nginx.conf:/etc/nginx/nginx.conf,
4650
`,
4751
RunE: func(cmd *cobra.Command, args []string) error {
48-
setContentHandler(cmd, args)
52+
err := setContentHandler(cmd, args)
53+
if err != nil {
54+
logging.Sugar.Error(err)
55+
}
4956
return nil
5057
},
5158
}

0 commit comments

Comments
 (0)