mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #11960 from tedyu/internal-create-err-chk
etcdserver: check error return for store#internalCreate
This commit is contained in:
commit
a09533d63d
@ -610,7 +610,9 @@ func (s *store) internalCreate(nodePath string, dir bool, value string, unique,
|
||||
}
|
||||
e.PrevNode = n.Repr(false, false, s.clock)
|
||||
|
||||
n.Remove(false, false, nil)
|
||||
if err := n.Remove(false, false, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, v2error.NewError(v2error.EcodeNodeExist, nodePath, currIndex)
|
||||
}
|
||||
@ -630,7 +632,9 @@ func (s *store) internalCreate(nodePath string, dir bool, value string, unique,
|
||||
}
|
||||
|
||||
// we are sure d is a directory and does not have the children with name n.Name
|
||||
d.Add(n)
|
||||
if err := d.Add(n); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// node with TTL
|
||||
if !n.IsPermanent() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user