Open aluode99 opened 4 years ago
We use Get() instead of Exists() because Exists() doesn't work correctly either for us.
And maybe i know the direct reason (not the real reason) is that we cannot do comparison like below in our own logic:
err == ErrNoNode
Instead, we do
err.Error() == ErrNoNode.Error()
Maybe they are not reused correctly inside though there was a error code map in constants.go
You should ignore all other return values in case non-nil error is returned. The exists
return value carries no meaning if an error was present
using Exists api return true when non-ErrNoNode occurs.
_, err := c.request(opExists, &existsRequest{Path: path, Watch: false}, res, nil) exists := true if err == ErrNoNode { exists = false err = nil } return exists, &res.Stat, err