From 2a675c08c2795c3144518401dd19c7dfda3a97d9 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Mon, 13 Apr 2015 09:58:07 -0700 Subject: [PATCH] store: always check the error Ensure that we propogate any errors out of the node.Remove operation back to the user. There is no reason to assume here. --- store/store.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/store/store.go b/store/store.go index fe2e2aaa0..54dd0f1a1 100644 --- a/store/store.go +++ b/store/store.go @@ -354,8 +354,10 @@ func (s *store) CompareAndDelete(nodePath string, prevValue string, prevIndex ui s.WatcherHub.notifyWatchers(e, path, true) } - // delete a key-value pair, no error should happen - n.Remove(false, false, callback) + err = n.Remove(false, false, callback) + if err != nil { + return nil, err + } s.WatcherHub.notify(e) s.Stats.Inc(CompareAndDeleteSuccess)