Skip to content

Commit

Permalink
binlogctl: return error when cmd not supported (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangXiangUSTC committed Jun 21, 2019
1 parent e77e090 commit 0b0000d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/binlogctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"flag"
"os"

"github.com/pingcap/errors"
"github.com/pingcap/log"
ctl "github.com/pingcap/tidb-binlog/binlogctl"
"github.com/pingcap/tidb-binlog/pkg/node"
Expand Down Expand Up @@ -59,6 +60,8 @@ func main() {
err = ctl.ApplyAction(cfg.EtcdURLs, node.PumpNode, cfg.NodeID, close)
case ctl.OfflineDrainer:
err = ctl.ApplyAction(cfg.EtcdURLs, node.DrainerNode, cfg.NodeID, close)
default:
err = errors.NotSupportedf("cmd %s", cfg.Command)
}

if err != nil {
Expand Down

0 comments on commit 0b0000d

Please sign in to comment.