Skip to content

Commit

Permalink
ticdc/server: output the cdc server cmd error to stderr (#3520) (#3875)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot committed Dec 16, 2021
1 parent ab3f501 commit 89e7f95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ func loop() {
command.SetArgs(args)
_ = command.ParseFlags(args)
command.SetOut(os.Stdout)
command.SetErr(os.Stdout)
command.SetErr(os.Stderr)
if err = command.Execute(); err != nil {
command.Println(err)
command.PrintErr(err.Error() + "\n")
}
}
}
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ var rootCmd = &cobra.Command{
func Execute() {
// Outputs cmd.Print to stdout.
rootCmd.SetOut(os.Stdout)
rootCmd.SetErr(os.Stderr)
if err := rootCmd.Execute(); err != nil {
rootCmd.Println(err)
rootCmd.PrintErr(err.Error() + "\n")
os.Exit(1)
}
}
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
Expand Down

0 comments on commit 89e7f95

Please sign in to comment.