From b5d5bf625d4c47c90c34cd65bc6b2957ee697a9b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 11 Feb 2016 15:01:33 -0800 Subject: [PATCH] etcdctlv3: put should check error --- etcdctlv3/command/put_command.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etcdctlv3/command/put_command.go b/etcdctlv3/command/put_command.go index 3b97bedbe..63435751c 100644 --- a/etcdctlv3/command/put_command.go +++ b/etcdctlv3/command/put_command.go @@ -71,6 +71,9 @@ func putCommandFunc(cmd *cobra.Command, args []string) { } req := &pb.PutRequest{Key: key, Value: value, Lease: id} - mustClient(cmd).KV.Put(context.Background(), req) + _, err = mustClient(cmd).KV.Put(context.Background(), req) + if err != nil { + ExitWithError(ExitError, err) + } fmt.Printf("%s %s\n", key, value) }