You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by eo...@apache.org on 2020/07/17 15:31:54 UTC

[zookeeper] branch master updated: ZOOKEEPER-3101: add reminder to ZOO_ERRORS

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b58e19  ZOOKEEPER-3101: add reminder to ZOO_ERRORS
5b58e19 is described below

commit 5b58e19c85ca1dfb8b2a0eec1411b34e6ca2e47b
Author: Kent R. Spillner <ks...@acm.org>
AuthorDate: Fri Jul 17 17:31:32 2020 +0200

    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 <ks...@acm.org>
    
    Reviewers: Enrico Olivelli <eo...@apache.org>, Norbert Kalmar <nk...@apache.org>, Benjamin Reed <br...@apache.org>
    
    Closes #581 from sl4mmy/zookeeper-3101
---
 zookeeper-client/zookeeper-client-c/include/zookeeper.h | 2 ++
 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 95959af..8bd1d95 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 8df4b29..d33b50c 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);