aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/src
diff options
context:
space:
mode:
authorParth Chandra <pchandra@maprtech.com>2015-01-02 15:22:31 -0800
committerParth Chandra <pchandra@maprtech.com>2015-01-06 17:30:46 -0800
commit363d30b54255840daa46959e1f7d8b2a779fa692 (patch)
treedd620a44f4bbfccf82d54b1d8defb852d39740ff /contrib/native/client/src
parent4304b25e8246970163966e5790231d7ffdbd308f (diff)
DRILL-1361: C++ Client needs a better error message when the handshake fails.
Diffstat (limited to 'contrib/native/client/src')
-rw-r--r--contrib/native/client/src/clientlib/drillClientImpl.cpp7
-rw-r--r--contrib/native/client/src/clientlib/errmsgs.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp
index 6f4a2ca56..84aa6cdb0 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -230,7 +230,12 @@ void DrillClientImpl::handleHandshake(ByteBuf_t _buf,
}else{
// boost error
- handleConnError(CONN_FAILURE, getMessage(ERR_CONN_RDFAIL, error.message().c_str()));
+ if(error==boost::asio::error::eof){ // Server broke off the connection
+ handleConnError(CONN_HANDSHAKE_FAILED,
+ getMessage(ERR_CONN_NOHSHAKE, DRILL_RPC_VERSION, m_handshakeVersion));
+ }else{
+ handleConnError(CONN_FAILURE, getMessage(ERR_CONN_RDFAIL, error.message().c_str()));
+ }
return;
}
return;
diff --git a/contrib/native/client/src/clientlib/errmsgs.cpp b/contrib/native/client/src/clientlib/errmsgs.cpp
index e09bda14e..a5e72172f 100644
--- a/contrib/native/client/src/clientlib/errmsgs.cpp
+++ b/contrib/native/client/src/clientlib/errmsgs.cpp
@@ -29,7 +29,7 @@ static Drill::ErrorMessages errorMessages[]={
{ERR_CONN_FAILURE, ERR_CATEGORY_CONN, 0, "Connection failure. Host:%s port:%s. Error: %s."},
{ERR_CONN_EXCEPT, ERR_CATEGORY_CONN, 0, "Socket connection failure with the following exception: %s."},
{ERR_CONN_UNKPROTO, ERR_CATEGORY_CONN, 0, "Unknown protocol: %s."},
- {ERR_CONN_RDFAIL, ERR_CATEGORY_CONN, 0, "A socket read failed with error: %s."},
+ {ERR_CONN_RDFAIL, ERR_CATEGORY_CONN, 0, "Connection failed with error: %s."},
{ERR_CONN_WFAIL, ERR_CATEGORY_CONN, 0, "Synchronous socket write failed with error: %s."},
{ERR_CONN_ZOOKEEPER, ERR_CATEGORY_CONN, 0, "Zookeeper error. %s"},
{ERR_CONN_NOHSHAKE, ERR_CATEGORY_CONN, 0, "Handshake failed: Expected RPC version %d, got %d."},