diff options
| author | Kent R. Spillner <kspillner@acm.org> | 2020-07-17 17:31:32 +0200 |
|---|---|---|
| committer | Enrico Olivelli <eolivelli@apache.org> | 2020-07-17 17:31:32 +0200 |
| commit | 5b58e19c85ca1dfb8b2a0eec1411b34e6ca2e47b (patch) | |
| tree | 9f4e13308ee7eef4e45302e8d35bf95b54b3328a | |
| parent | f362313860401024b7141489e66ee76af442eb76 (diff) | |
| download | zookeeper-5b58e19c85ca1dfb8b2a0eec1411b34e6ca2e47b.tar.gz | |
ZOOKEEPER-3101: add reminder to ZOO_ERRORS
Add comment at bottom of ZOO_ERRORS reminding developers to also
update zerror(int) when adding or changing values. Suggested by
phunt in https://github.com/apache/zookeeper/pull/575#issuecomment-406356144.
Signed-off-by: Kent R. Spillner <kspillneracm.org>
Author: Kent R. Spillner <kspillner@acm.org>
Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>, Benjamin Reed <breed@apache.org>
Closes #581 from sl4mmy/zookeeper-3101
| -rw-r--r-- | zookeeper-client/zookeeper-client-c/include/zookeeper.h | 2 | ||||
| -rw-r--r-- | zookeeper-client/zookeeper-client-c/src/zookeeper.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/zookeeper-client/zookeeper-client-c/include/zookeeper.h b/zookeeper-client/zookeeper-client-c/include/zookeeper.h index 95959af56..8bd1d95db 100644 --- a/zookeeper-client/zookeeper-client-c/include/zookeeper.h +++ b/zookeeper-client/zookeeper-client-c/include/zookeeper.h @@ -142,6 +142,8 @@ enum ZOO_ERRORS { ZRECONFIGDISABLED = -123, /*!< Attempts to perform a reconfiguration operation when reconfiguration feature is disabled */ ZSESSIONCLOSEDREQUIRESASLAUTH = -124, /*!< The session has been closed by server because server requires client to do SASL authentication, but client is not configured with SASL authentication or configuted with SASL but failed (i.e. wrong credential used.). */ ZTHROTTLEDOP = -127 /*!< Operation was throttled and not executed at all. please, retry! */ + + /* when adding/changing values here also update zerror(int) to return correct error message */ }; #ifdef __cplusplus diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c index 8df4b29dc..d33b50c81 100644 --- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c +++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c @@ -4958,8 +4958,10 @@ const char* zerror(int c) return "the watcher couldn't be found"; case ZRECONFIGDISABLED: return "attempts to perform a reconfiguration operation when reconfiguration feature is disable"; - case ZTHROTTLEDOP: - return "Operation was throttled due to high load"; + case ZSESSIONCLOSEDREQUIRESASLAUTH: + return "session closed by server because client is required to do SASL authentication"; + case ZTHROTTLEDOP: + return "Operation was throttled due to high load"; } if (c > 0) { return strerror(c); |
