Skip to content

Commit

Permalink
fix: Set exit flag when create/delete command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
joeirimpan committed Aug 31, 2022
1 parent 6221d27 commit 7a86f51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/kaf/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ var createTopicCmd = &cobra.Command{
},
}, false)
if err != nil {
fmt.Printf("Could not create topic %v: %v\n", topicName, err.Error())
errorExit("Could not create topic %v: %v\n", topicName, err.Error())
} else {
w := tabwriter.NewWriter(outWriter, tabwriterMinWidth, tabwriterWidth, tabwriterPadding, tabwriterPadChar, tabwriterFlags)
fmt.Fprintf(w, "\xE2\x9C\x85 Created topic!\n")
Expand Down Expand Up @@ -325,7 +325,7 @@ var deleteTopicCmd = &cobra.Command{
topicName := args[0]
err := admin.DeleteTopic(topicName)
if err != nil {
fmt.Fprintf(outWriter, "Could not delete topic %v: %v\n", topicName, err.Error())
errorExit("Could not delete topic %v: %v\n", topicName, err.Error())
} else {
fmt.Fprintf(outWriter, "\xE2\x9C\x85 Deleted topic %v!\n", topicName)
}
Expand Down

0 comments on commit 7a86f51

Please sign in to comment.