diff options
author | norrislee <norrislee18@hotmail.com> | 2015-05-01 16:20:32 -0700 |
---|---|---|
committer | Parth Chandra <pchandra@maprtech.com> | 2015-05-05 19:29:18 -0700 |
commit | 0e161417715652339580c4c6b1f630676b260997 (patch) | |
tree | 8e249481e0e97a8e9b726216cc8e7b5d8325f84a /contrib/native/client/src | |
parent | 60c0f86f5f6033847d9f38d4d3700760a3e7f45a (diff) |
DRILL-2885: Return more precise error codes on handshake failures in C++ client
Diffstat (limited to 'contrib/native/client/src')
-rw-r--r-- | contrib/native/client/src/clientlib/drillClientImpl.cpp | 4 | ||||
-rw-r--r-- | contrib/native/client/src/include/drill/common.hpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp index 5bbbeb8e9..eca0e7516 100644 --- a/contrib/native/client/src/clientlib/drillClientImpl.cpp +++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp @@ -340,14 +340,14 @@ connectionStatus_t DrillClientImpl::validateHandshake(DrillUserProperties* prope case exec::user::RPC_VERSION_MISMATCH: DRILL_LOG(LOG_TRACE) << "Invalid rpc version. Expected " << DRILL_RPC_VERSION << ", actual "<< m_handshakeVersion << "." << std::endl; - return handleConnError(CONN_HANDSHAKE_FAILED, + return handleConnError(CONN_BAD_RPC_VER, getMessage(ERR_CONN_BAD_RPC_VER, DRILL_RPC_VERSION, m_handshakeVersion, this->m_handshakeErrorId.c_str(), this->m_handshakeErrorMsg.c_str())); case exec::user::AUTH_FAILED: DRILL_LOG(LOG_TRACE) << "Authentication failed." << std::endl; - return handleConnError(CONN_HANDSHAKE_FAILED, + return handleConnError(CONN_AUTH_FAILED, getMessage(ERR_CONN_AUTHFAIL, this->m_handshakeErrorId.c_str(), this->m_handshakeErrorMsg.c_str())); diff --git a/contrib/native/client/src/include/drill/common.hpp b/contrib/native/client/src/include/drill/common.hpp index 6662754d2..2fa09545c 100644 --- a/contrib/native/client/src/include/drill/common.hpp +++ b/contrib/native/client/src/include/drill/common.hpp @@ -107,7 +107,9 @@ typedef enum{ CONN_INVALID_INPUT=3, CONN_ZOOKEEPER_ERROR=4, CONN_HANDSHAKE_TIMEOUT=5, - CONN_HOSTNAME_RESOLUTION_ERROR=6 + CONN_HOSTNAME_RESOLUTION_ERROR=6, + CONN_AUTH_FAILED=7, + CONN_BAD_RPC_VER=8 } connectionStatus_t; typedef enum{ |