You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bb...@apache.org on 2019/07/15 21:49:57 UTC

[geode-native] branch develop updated: GEODE-6961: Trim leading whitespace from server error message (#503)

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

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new da0a4bb  GEODE-6961: Trim leading whitespace from server error message (#503)
da0a4bb is described below

commit da0a4bb4e72c17fb8ab3d53c56eb5a23beede4a6
Author: Blake Bender <bb...@pivotal.io>
AuthorDate: Mon Jul 15 14:49:52 2019 -0700

    GEODE-6961: Trim leading whitespace from server error message (#503)
---
 cppcache/src/TcrMessage.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/cppcache/src/TcrMessage.cpp b/cppcache/src/TcrMessage.cpp
index ac6d478..f1a51fe 100644
--- a/cppcache/src/TcrMessage.cpp
+++ b/cppcache/src/TcrMessage.cpp
@@ -1098,6 +1098,13 @@ void TcrMessage::processChunk(const std::vector<uint8_t>& chunk, int32_t len,
         auto errorString = readStringPart(input);
 
         if (!errorString.empty()) {
+          errorString.erase(
+              errorString.begin(),
+              std::find_if(errorString.begin(), errorString.end(),
+                           std::not1(std::ptr_fun<int, int>(std::isspace))));
+          LOGDEBUG(
+              "TcrMessage::%s: setting thread-local ex msg to \"%s\", %s, %d",
+              __FUNCTION__, errorString.c_str(), __FILE__, __LINE__);
           setThreadLocalExceptionMessage(errorString.c_str());
         }
       }