GEODE-6961: Trim leading whitespace from server error message (#503)
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 @@
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());
}
}