You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by dg...@apache.org on 2017/11/17 00:46:35 UTC
[geode-native] branch develop updated: GEODE-3624: Update C++
client exceptions to implement std::exception interface (#152)
This is an automated email from the ASF dual-hosted git repository.
dgkimura 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 8d8e9a7 GEODE-3624: Update C++ client exceptions to implement std::exception interface (#152)
8d8e9a7 is described below
commit 8d8e9a7ee089b1c871d0db308e8277a1ae4bd5ae
Author: David Kimura <dk...@pivotal.io>
AuthorDate: Thu Nov 16 16:46:34 2017 -0800
GEODE-3624: Update C++ client exceptions to implement std::exception interface (#152)
---
clicache/integration-test/ThinClientPoolTestsN.cs | 4 +-
clicache/src/ExceptionTypes.cpp | 10 +-
clicache/src/ExceptionTypes.hpp | 20 +-
cppcache/include/geode/Exception.hpp | 63 +--
cppcache/include/geode/ExceptionTypes.hpp | 477 +++++++++++++++++----
cppcache/integration-test/BBNamingContext.cpp | 12 +-
cppcache/integration-test/CacheHelper.cpp | 10 +-
cppcache/integration-test/DeltaEx.hpp | 4 +-
cppcache/integration-test/ThinClientDistOps.hpp | 14 +-
cppcache/integration-test/ThinClientPutAll.hpp | 4 +-
.../integration-test/ThinClientPutAllTimeout.hpp | 12 +-
.../ThinClientPutAllWithCallBack.hpp | 4 +-
cppcache/integration-test/ThinClientRegex3.hpp | 8 +-
.../integration-test/ThinClientSecurityHelper.hpp | 6 +-
cppcache/integration-test/ThinClientTXFailover.hpp | 2 +-
.../integration-test/ThinClientTransactions.hpp | 10 +-
.../integration-test/ThinClientTransactionsXA.hpp | 10 +-
cppcache/integration-test/fw_dunit.hpp | 16 +-
cppcache/integration-test/fw_helper.hpp | 2 +-
cppcache/integration-test/testCache.cpp | 20 +-
cppcache/integration-test/testConnect.cpp | 4 +-
cppcache/integration-test/testLogger.cpp | 3 +-
.../integration-test/testOverflowPutGetSqLite.cpp | 6 +-
.../testRegionAccessThreadSafe.cpp | 4 +-
.../testThinClientCacheableStringArray.cpp | 4 +-
cppcache/integration-test/testThinClientCq.cpp | 26 +-
.../integration-test/testThinClientCqDurable.cpp | 12 +-
.../integration-test/testThinClientCqFailover.cpp | 8 +-
.../testThinClientCqHAFailover.cpp | 8 +-
cppcache/integration-test/testThinClientCqIR.cpp | 4 +-
.../testThinClientExecuteFunctionPrSHOP.cpp | 4 +-
.../testThinClientFixedPartitionResolver.cpp | 10 +-
.../testThinClientHAQueryFailover.cpp | 4 +-
.../testThinClientInterest1_Bug1001.cpp | 4 +-
.../testThinClientInterestNotify.cpp | 2 +-
.../testThinClientLRUExpiration.cpp | 6 +-
.../testThinClientListenerCallbackArgTest.cpp | 4 +-
.../testThinClientLocatorFailover.cpp | 16 +-
.../integration-test/testThinClientMultiDS.cpp | 20 +-
.../testThinClientPRPutAllFailover.cpp | 32 +-
.../integration-test/testThinClientPRSingleHop.cpp | 36 +-
.../testThinClientPRSingleHopServerGroup.cpp | 24 +-
.../integration-test/testThinClientPdxTests.cpp | 12 +-
.../testThinClientPoolAttrTest.cpp | 2 +-
.../testThinClientPoolExecuteFunction.cpp | 10 +-
...oolExecuteFunctionDisableChunkHandlerThread.cpp | 2 +-
.../testThinClientPoolExecuteFunctionPrSHOP.cpp | 4 +-
.../testThinClientPoolExecuteHAFunction.cpp | 8 +-
.../testThinClientPoolExecuteHAFunctionPrSHOP.cpp | 8 +-
.../integration-test/testThinClientPoolLocator.cpp | 29 +-
.../testThinClientPutAllPRSingleHop.cpp | 8 +-
...ThinClientRegionQueryDifferentServerConfigs.cpp | 6 +-
.../testThinClientRemoteQueryFailover.cpp | 4 +-
.../testThinClientRemoteQueryFailoverPdx.cpp | 4 +-
.../testThinClientRemoteQuerySS.cpp | 2 +-
.../testThinClientRemoteQueryTimeout.cpp | 16 +-
.../testThinClientRemoteRegionQuery.cpp | 24 +-
.../integration-test/testThinClientRemoveOps.cpp | 16 +-
.../testThinClientSSLWithSecurityAuthz.cpp | 8 +-
.../testThinClientSecurityAuthentication.cpp | 56 +--
.../testThinClientSecurityAuthenticationMU.cpp | 60 +--
...ientSecurityAuthenticationSetAuthInitialize.cpp | 4 +-
.../testThinClientSecurityAuthorization.cpp | 8 +-
.../testThinClientSecurityAuthorizationMU.cpp | 20 +-
.../testThinClientSecurityCQAuthorizationMU.cpp | 4 +-
.../integration-test/testThinClientSecurityDH.cpp | 24 +-
.../testThinClientSecurityDH_MU.cpp | 24 +-
...tThinClientSecurityDurableCQAuthorizationMU.cpp | 4 +-
.../testThinClientSecurityMultiUserTest.cpp | 16 +-
.../testThinClientSecurityPostAuthorization.cpp | 10 +-
.../integration-test/testThinClientStatistics.cpp | 4 +-
.../testThinClientWriterException.cpp | 4 +-
.../testXmlCacheCreationWithOverFlow.cpp | 32 +-
.../testXmlCacheCreationWithPools.cpp | 36 +-
.../testXmlCacheCreationWithRefid.cpp | 8 +-
cppcache/src/Assert.cpp | 12 +-
cppcache/src/CMakeLists.txt | 1 +
cppcache/src/CacheImpl.cpp | 4 +-
cppcache/src/CacheTransactionManagerImpl.cpp | 6 +-
cppcache/src/CacheXmlParser.cpp | 22 +-
cppcache/src/CacheableObjectPartList.cpp | 10 +-
cppcache/src/ClientProxyMembershipIDFactory.cpp | 2 +-
cppcache/src/CqAttributesImpl.cpp | 4 +-
cppcache/src/CqQueryImpl.cpp | 14 +-
cppcache/src/CqService.cpp | 31 +-
cppcache/src/DistributedSystem.cpp | 7 +-
cppcache/src/Exception.cpp | 99 +----
cppcache/src/ExceptionTypes.cpp | 221 +++++-----
cppcache/src/ExecutionImpl.cpp | 8 +-
.../src/InternalCacheTransactionManager2PCImpl.cpp | 4 +-
cppcache/src/LRUAction.cpp | 4 +-
cppcache/src/LRUEntriesMap.cpp | 4 +-
cppcache/src/LocalRegion.cpp | 13 +-
cppcache/src/LocalRegion.hpp | 5 +-
cppcache/src/Log.cpp | 4 +-
cppcache/src/ProxyRemoteQueryService.cpp | 12 +-
.../src/PutAllPartialResultServerException.cpp | 43 +-
.../src/PutAllPartialResultServerException.hpp | 2 +-
cppcache/src/StackFrame.hpp | 150 -------
cppcache/src/StackTrace.cpp | 180 +-------
cppcache/src/StackTrace.hpp | 32 +-
cppcache/src/TXState.cpp | 6 +-
cppcache/src/TcrChunkedContext.hpp | 12 +-
cppcache/src/TcrConnection.cpp | 28 +-
cppcache/src/TcrConnectionManager.cpp | 2 +-
cppcache/src/TcrEndpoint.cpp | 26 +-
cppcache/src/TcrMessage.cpp | 13 +-
.../src/ThinClientCacheDistributionManager.cpp | 2 +-
cppcache/src/ThinClientHARegion.cpp | 4 +-
cppcache/src/ThinClientLocatorHelper.cpp | 8 +-
cppcache/src/ThinClientPoolDM.cpp | 2 +-
cppcache/src/ThinClientPoolRegion.cpp | 2 +-
cppcache/src/ThinClientRedundancyManager.cpp | 4 +-
cppcache/src/ThinClientRegion.cpp | 30 +-
cppcache/src/Utils.cpp | 2 +-
cppcache/src/VersionedCacheableObjectPartList.cpp | 8 +-
cppcache/src/statistics/GeodeStatisticsFactory.cpp | 7 +-
cppcache/src/statistics/HostStatHelperSolaris.cpp | 2 +-
cppcache/src/statistics/HostStatSampler.cpp | 4 +-
cppcache/src/statistics/PoolStatsSampler.cpp | 9 +-
.../StackFrame.cpp => test/ExceptionTypesTest.cpp} | 35 +-
dependencies/boost/CMakeLists.txt | 1 +
tests/cli/CMakeLists.txt | 2 +-
tests/cpp/fwk/UdpIpc.cpp | 8 +-
tests/cpp/fwklib/FrameworkTest.cpp | 10 +-
tests/cpp/fwklib/FwkBBClient.cpp | 32 +-
tests/cpp/fwklib/FwkBBServer.hpp | 4 +-
tests/cpp/fwklib/FwkLog.cpp | 5 +-
tests/cpp/fwklib/QueryHelper.hpp | 4 +-
tests/cpp/fwklib/Service.cpp | 2 +-
tests/cpp/fwklib/Service.hpp | 2 +-
tests/cpp/fwklib/TestClient.cpp | 4 +-
tests/cpp/fwklib/UDPIpc.cpp | 8 +-
tests/cpp/fwklib/UDPIpc.hpp | 2 +-
tests/cpp/fwklib/testframeworkdox.txt | 2 +-
tests/cpp/security/Security.cpp | 76 ++--
tests/cpp/testobject/ArrayOfByte.hpp | 8 +-
tests/cpp/testobject/InvalidPdxUsage.cpp | 168 ++++----
138 files changed, 1352 insertions(+), 1512 deletions(-)
diff --git a/clicache/integration-test/ThinClientPoolTestsN.cs b/clicache/integration-test/ThinClientPoolTestsN.cs
index a65e7b6..b1a7b91 100644
--- a/clicache/integration-test/ThinClientPoolTestsN.cs
+++ b/clicache/integration-test/ThinClientPoolTestsN.cs
@@ -544,13 +544,13 @@ namespace Apache.Geode.Client.UnitTests
{
InvalidateEntry(RegionName, m_keys[0]);
UpdateEntry(RegionName, m_keys[1], m_vals[1], false);
- Assert.Fail("Did not get expected NotConnectedException with cause NoAvailableLocatorsException");
+ Assert.Fail("Did not get expected NotConnectedException");
}
catch (NotConnectedException excp)
{
if (excp.InnerException is NoAvailableLocatorsException)
{
- Util.Log("Got expected NoAvailableLocatorsException");
+ Util.Log("Got expected NoAvailableLocatorsException with cause NoAvailableLocatorsException");
}
else
{
diff --git a/clicache/src/ExceptionTypes.cpp b/clicache/src/ExceptionTypes.cpp
index 3c91e42..b1e1c3e 100644
--- a/clicache/src/ExceptionTypes.cpp
+++ b/clicache/src/ExceptionTypes.cpp
@@ -112,16 +112,18 @@ namespace Apache
System::Exception^ GeodeException::Get(const apache::geode::client::Exception& nativeEx)
{
Exception^ innerException = nullptr;
- const auto cause = nativeEx.getCause();
- if (cause != nullptr) {
- innerException = GeodeException::Get(*cause);
+ try
+ {
+ std::rethrow_if_nested(nativeEx);
+ } catch (const apache::geode::client::Exception& ex) {
+ innerException = GeodeException::Get(ex);
}
String^ exName = gcnew String( nativeEx.getName( ) );
CreateException2^ exDelegate;
if (Native2ManagedExMap->TryGetValue(exName, exDelegate)) {
return exDelegate(nativeEx, innerException);
}
- String^ exMsg = ManagedString::Get( nativeEx.getMessage( ) );
+ String^ exMsg = ManagedString::Get( nativeEx.what( ) );
if ( exMsg->StartsWith( GeodeException::MgSysExPrefix ) ) {
// Get the exception type
String^ mgExStr = exMsg->Substring(
diff --git a/clicache/src/ExceptionTypes.hpp b/clicache/src/ExceptionTypes.hpp
index 6ac31b4..e529cb4 100644
--- a/clicache/src/ExceptionTypes.hpp
+++ b/clicache/src/ExceptionTypes.hpp
@@ -165,8 +165,9 @@ namespace Apache
cause = GeodeException::GetNative(ex->InnerException);
}
ManagedString mg_exStr(MgSysExPrefix + ex->ToString());
+ auto message = std::string(mg_exStr.CharPtr) + cause->what();
return std::make_shared<apache::geode::client::Exception>(
- mg_exStr.CharPtr, __nullptr, false, cause);
+ message);
}
}
return nullptr;
@@ -184,8 +185,8 @@ namespace Apache
if (this->InnerException != nullptr) {
cause = GeodeException::GetNative(this->InnerException);
}
- return std::make_shared<apache::geode::client::Exception>(mg_msg.CharPtr,
- __nullptr, false, cause);
+ auto message = std::string(mg_msg.CharPtr) + cause->what();
+ return std::make_shared<apache::geode::client::Exception>(message);
}
/// <summary>
@@ -210,7 +211,8 @@ namespace Apache
cause = GeodeException::GetNative(ex->InnerException);
}
ManagedString mg_exStr(MgSysExPrefix + ex->ToString());
- throw apache::geode::client::Exception(mg_exStr.CharPtr, NULL, false, cause);
+ auto message = std::string(mg_exStr.CharPtr) + cause->what();
+ throw apache::geode::client::Exception(message);
}
}
@@ -220,7 +222,7 @@ namespace Apache
/// </summary>
inline void ThrowNative()
{
- GetNative()->raise();
+ throw GetNative();
}
@@ -328,12 +330,12 @@ namespace Apache
\
internal: \
x(const apache::geode::client::y& nativeEx) \
- : GeodeException(ManagedString::Get(nativeEx.getMessage()), \
+ : GeodeException(ManagedString::Get(nativeEx.what()), \
gcnew GeodeException(GeodeException::GetStackTrace( \
nativeEx))) { } \
\
x(const apache::geode::client::y& nativeEx, Exception^ innerException) \
- : GeodeException(ManagedString::Get(nativeEx.getMessage()), \
+ : GeodeException(ManagedString::Get(nativeEx.what()), \
innerException) { } \
\
static GeodeException^ Create(const apache::geode::client::Exception& ex, \
@@ -358,8 +360,8 @@ namespace Apache
if (this->InnerException != nullptr) { \
cause = GeodeException::GetNative(this->InnerException); \
} \
- return std::make_shared<apache::geode::client::y>(mg_msg.CharPtr, \
- __nullptr, false, cause); \
+ auto message = std::string(mg_msg.CharPtr) + cause->what(); \
+ return std::make_shared<apache::geode::client::y>(message); \
} \
}
diff --git a/cppcache/include/geode/Exception.hpp b/cppcache/include/geode/Exception.hpp
index ae50d31..bde8160 100644
--- a/cppcache/include/geode/Exception.hpp
+++ b/cppcache/include/geode/Exception.hpp
@@ -21,7 +21,9 @@
#define GEODE_EXCEPTION_H_
#include <string>
+#include <stdexcept>
#include <unordered_map>
+
#include "geode_globals.hpp"
#include "util/functional.hpp"
@@ -42,21 +44,15 @@ class StackTrace;
* @class Exception Exception.hpp
* A description of an exception that occurred during a cache operation.
*/
-class CPPCACHE_EXPORT Exception {
+class CPPCACHE_EXPORT Exception : public std::exception {
/**
* @brief public methods
*/
public:
/** Creates an exception.
* @param msg1 message pointer, this is copied into the exception.
- * @param msg2 optional extra message pointer, appended to msg1.
- * @param forceTrace enables a stacktrace for this exception regardless of
- * stacktrace-enabled system property.
- * @param cause optional cause of the exception which can be later
- * retrieved using <code>getCause</code>
**/
- Exception(const char* msg1, const char* msg2 = nullptr,
- bool forceTrace = false, const std::shared_ptr<Exception>& cause = nullptr);
+ explicit Exception(const char* msg1);
explicit Exception(const std::string& msg1);
@@ -64,64 +60,27 @@ class CPPCACHE_EXPORT Exception {
* @param other the original exception.
*
**/
- Exception(const Exception& other) noexcept = default;
+ Exception(const Exception& other) = default;
Exception(Exception&& other) noexcept = default;
- /** Create a clone of this exception. */
- virtual Exception* clone() const;
-
/**
* @brief destructor
*/
- virtual ~Exception();
-
- /** Returns the message pointer
- *
- * @return message pointer
- */
- virtual const char* getMessage() const;
- /** Show the message pointer
- *
- */
- virtual void showMessage() const;
-
- /** On some platforms, print a stacktrace from the location the exception
- * was created.
- */
- virtual void printStackTrace() const;
+ virtual ~Exception() noexcept;
-#ifndef _SOLARIS
- /** On some platforms, get a stacktrace string from the location the
- * exception was created.
+ /** Get a stacktrace string from the location the exception was created.
*/
- virtual size_t getStackTrace(char* buffer, size_t maxLength) const;
-#endif
+ virtual std::string getStackTrace() const;
/** Return the name of this exception type. */
virtual const char* getName() const;
- /**
- * Throw polymorphically; this allows storing an exception object
- * pointer and throwing it later.
- */
- virtual void raise() { throw *this; }
-
- inline std::shared_ptr<Exception> getCause() const { return m_cause; }
+ virtual const char *what() const noexcept override;
- protected:
- /** internal constructor used to clone this exception */
- Exception(const std::shared_ptr<CacheableString>& message,
- const std::shared_ptr<StackTrace>& stack,
- const std::shared_ptr<Exception>& cause);
-
- static bool s_exceptionStackTraceEnabled;
-
- std::shared_ptr<CacheableString> m_message; // error message
+ private:
std::shared_ptr<StackTrace> m_stack;
- std::shared_ptr<Exception> m_cause;
- private:
- static void setStackTraces(bool stackTraceEnabled);
+ std::string message;
friend class DistributedSystem;
};
diff --git a/cppcache/include/geode/ExceptionTypes.hpp b/cppcache/include/geode/ExceptionTypes.hpp
index 2dd5ddd..ba5a9b5 100644
--- a/cppcache/include/geode/ExceptionTypes.hpp
+++ b/cppcache/include/geode/ExceptionTypes.hpp
@@ -20,41 +20,12 @@
#ifndef GEODE_EXCEPTIONTYPES_H_
#define GEODE_EXCEPTIONTYPES_H_
-/**
- * @file
- */
#include "geode_globals.hpp"
#include "geode/Exception.hpp"
-#include <memory>
namespace apache {
namespace geode {
namespace client {
-class StackTrace;
-class CacheableString;
-
-#define _GF_EXCEPTION_DEF(x) \
- const char _exception_name_##x[] = "apache::geode::client::" #x; \
- class x; \
- class CPPCACHE_EXPORT x : public apache::geode::client::Exception { \
- public: \
- using Exception::Exception; \
- virtual Exception* clone() const { \
- return new x(m_message, m_stack, m_cause); \
- } \
- virtual ~x() {} \
- virtual const char* getName() const { return _exception_name_##x; } \
- virtual void raise() { throw * this; } \
- \
- protected: \
- x(const std::shared_ptr<CacheableString>& message, \
- const std::shared_ptr<StackTrace>& stack, \
- const std::shared_ptr<Exception>& cause) \
- : Exception(message, stack, cause) {} \
- \
- private: \
- const x& operator=(const x&); \
- }
/*
*
@@ -66,265 +37,525 @@ class CacheableString;
/**
*@brief A geode assertion exception.
**/
-_GF_EXCEPTION_DEF(AssertionException);
+class CPPCACHE_EXPORT AssertionException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~AssertionException() {}
+ virtual const char* getName() const override { return "apache::geode::client::AssertionException"; }
+};
/**
*@brief Thrown when an argument to a method is illegal.
**/
-_GF_EXCEPTION_DEF(IllegalArgumentException);
+class CPPCACHE_EXPORT IllegalArgumentException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~IllegalArgumentException() {}
+ virtual const char* getName() const override { return "apache::geode::client::IllegalArgumentException"; }
+};
/**
*@brief Thrown when the state of cache is manipulated to be illegal.
**/
-_GF_EXCEPTION_DEF(IllegalStateException);
+class CPPCACHE_EXPORT IllegalStateException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~IllegalStateException() {}
+ virtual const char* getName() const override { return "apache::geode::client::IllegalStateException"; }
+};
/**
*@brief Thrown when an attempt is made to create an existing cache.
**/
-_GF_EXCEPTION_DEF(CacheExistsException);
+class CPPCACHE_EXPORT CacheExistsException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheExistsException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheExistsException"; }
+};
/**
*@brief Thrown when the cache xml is incorrect.
**/
-_GF_EXCEPTION_DEF(CacheXmlException);
+class CPPCACHE_EXPORT CacheXmlException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheXmlException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheXmlException"; }
+};
/**
*@brief Thrown when a timout occurs.
**/
-_GF_EXCEPTION_DEF(TimeoutException);
+class CPPCACHE_EXPORT TimeoutException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~TimeoutException() {}
+ virtual const char* getName() const override { return "apache::geode::client::TimeoutException"; }
+};
/**
*@brief Thrown when the cache writer aborts the operation.
**/
-_GF_EXCEPTION_DEF(CacheWriterException);
+class CPPCACHE_EXPORT CacheWriterException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheWriterException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheWriterException"; }
+};
/**
*@brief Thrown when an attempt is made to create an existing region.
**/
-_GF_EXCEPTION_DEF(RegionExistsException);
+class CPPCACHE_EXPORT RegionExistsException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~RegionExistsException() {}
+ virtual const char* getName() const override { return "apache::geode::client::RegionExistsException"; }
+};
/**
*@brief Thrown when an operation is attempted on a closed cache.
**/
-_GF_EXCEPTION_DEF(CacheClosedException);
+class CPPCACHE_EXPORT CacheClosedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheClosedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheClosedException"; }
+};
/**
*@brief Thrown when lease of cache proxy has expired.
**/
-_GF_EXCEPTION_DEF(LeaseExpiredException);
+class CPPCACHE_EXPORT LeaseExpiredException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~LeaseExpiredException() {}
+ virtual const char* getName() const override { return "apache::geode::client::LeaseExpiredException"; }
+};
/**
*@brief Thrown when the cache loader aborts the operation.
**/
-_GF_EXCEPTION_DEF(CacheLoaderException);
+class CPPCACHE_EXPORT CacheLoaderException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheLoaderException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheLoaderException"; }
+};
/**
*@brief Thrown when an operation is attempted on a destroyed region.
**/
-_GF_EXCEPTION_DEF(RegionDestroyedException);
+class CPPCACHE_EXPORT RegionDestroyedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~RegionDestroyedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::RegionDestroyedException"; }
+};
/**
*@brief Thrown when an operation is attempted on a destroyed entry.
**/
-_GF_EXCEPTION_DEF(EntryDestroyedException);
+class CPPCACHE_EXPORT EntryDestroyedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~EntryDestroyedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::EntryDestroyedException"; }
+};
/**
*@brief Thrown when the connecting target is not running.
**/
-_GF_EXCEPTION_DEF(NoSystemException);
+class CPPCACHE_EXPORT NoSystemException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NoSystemException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NoSystemException"; }
+};
/**
*@brief Thrown when an attempt is made to connect to
* DistributedSystem second time.
**/
-_GF_EXCEPTION_DEF(AlreadyConnectedException);
+class CPPCACHE_EXPORT AlreadyConnectedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~AlreadyConnectedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::AlreadyConnectedException"; }
+};
/**
*@brief Thrown when a non-existing file is accessed.
**/
-_GF_EXCEPTION_DEF(FileNotFoundException);
+class CPPCACHE_EXPORT FileNotFoundException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~FileNotFoundException() {}
+ virtual const char* getName() const override { return "apache::geode::client::FileNotFoundException"; }
+};
/**
*@brief Thrown when an operation is interrupted.
**/
-_GF_EXCEPTION_DEF(InterruptedException);
+class CPPCACHE_EXPORT InterruptedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~InterruptedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::InterruptedException"; }
+};
/**
*@brief Thrown when an operation unsupported by the
* current configuration is attempted.
**/
-_GF_EXCEPTION_DEF(UnsupportedOperationException);
+class CPPCACHE_EXPORT UnsupportedOperationException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~UnsupportedOperationException() {}
+ virtual const char* getName() const override { return "apache::geode::client::UnsupportedOperationException"; }
+};
/**
*@brief Thrown when statistics are invoked for a region where
* they are disabled.
**/
-_GF_EXCEPTION_DEF(StatisticsDisabledException);
+class CPPCACHE_EXPORT StatisticsDisabledException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~StatisticsDisabledException() {}
+ virtual const char* getName() const override { return "apache::geode::client::StatisticsDisabledException"; }
+};
/**
*@brief Thrown when a concurrent operation fails.
**/
-_GF_EXCEPTION_DEF(ConcurrentModificationException);
+class CPPCACHE_EXPORT ConcurrentModificationException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~ConcurrentModificationException() {}
+ virtual const char* getName() const override { return "apache::geode::client::ConcurrentModificationException"; }
+};
/**
*@brief An unknown exception occurred.
**/
-_GF_EXCEPTION_DEF(UnknownException);
+class CPPCACHE_EXPORT UnknownException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~UnknownException() {}
+ virtual const char* getName() const override { return "apache::geode::client::UnknownException"; }
+};
/**
*@brief Thrown when a cast operation fails.
**/
-_GF_EXCEPTION_DEF(ClassCastException);
+class CPPCACHE_EXPORT ClassCastException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~ClassCastException() {}
+ virtual const char* getName() const override { return "apache::geode::client::ClassCastException"; }
+};
/**
*@brief Thrown when an operation is attempted on a non-existent entry.
**/
-_GF_EXCEPTION_DEF(EntryNotFoundException);
+class CPPCACHE_EXPORT EntryNotFoundException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~EntryNotFoundException() {}
+ virtual const char* getName() const override { return "apache::geode::client::EntryNotFoundException"; }
+};
/**
*@brief Thrown when there is an input/output error.
**/
-_GF_EXCEPTION_DEF(GeodeIOException);
+class CPPCACHE_EXPORT GeodeIOException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~GeodeIOException() {}
+ virtual const char* getName() const override { return "apache::geode::client::GeodeIOException"; }
+};
/**
*@brief Thrown when geode configuration file is incorrect.
**/
-_GF_EXCEPTION_DEF(GeodeConfigException);
+class CPPCACHE_EXPORT GeodeConfigException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~GeodeConfigException() {}
+ virtual const char* getName() const override { return "apache::geode::client::GeodeConfigException"; }
+};
/**
*@brief Thrown when a null argument is provided to a method
* where it is expected to be non-null.
**/
-_GF_EXCEPTION_DEF(NullPointerException);
+class CPPCACHE_EXPORT NullPointerException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NullPointerException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NullPointerException"; }
+};
/**
*@brief Thrown when attempt is made to create an existing entry.
**/
-_GF_EXCEPTION_DEF(EntryExistsException);
+class CPPCACHE_EXPORT EntryExistsException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~EntryExistsException() {}
+ virtual const char* getName() const override { return "apache::geode::client::EntryExistsException"; }
+};
/**
*@brief Thrown when an operation is attempted before connecting
* to the distributed system.
**/
-_GF_EXCEPTION_DEF(NotConnectedException);
+class CPPCACHE_EXPORT NotConnectedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NotConnectedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NotConnectedException"; }
+};
/**
*@brief Thrown when there is an error in the cache proxy.
**/
-_GF_EXCEPTION_DEF(CacheProxyException);
+class CPPCACHE_EXPORT CacheProxyException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheProxyException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheProxyException"; }
+};
/**
*@brief Thrown when the system cannot allocate any more memory.
**/
-_GF_EXCEPTION_DEF(OutOfMemoryException);
+class CPPCACHE_EXPORT OutOfMemoryException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~OutOfMemoryException() {}
+ virtual const char* getName() const override { return "apache::geode::client::OutOfMemoryException"; }
+};
/**
*@brief Thrown when an attempt is made to release a lock not
* owned by the thread.
**/
-_GF_EXCEPTION_DEF(NotOwnerException);
+class CPPCACHE_EXPORT NotOwnerException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NotOwnerException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NotOwnerException"; }
+};
/**
*@brief Thrown when a region is created in an incorrect scope.
**/
-_GF_EXCEPTION_DEF(WrongRegionScopeException);
+class CPPCACHE_EXPORT WrongRegionScopeException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~WrongRegionScopeException() {}
+ virtual const char* getName() const override { return "apache::geode::client::WrongRegionScopeException"; }
+};
/**
*@brief Thrown when the internal buffer size is exceeded.
**/
-_GF_EXCEPTION_DEF(BufferSizeExceededException);
+class CPPCACHE_EXPORT BufferSizeExceededException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~BufferSizeExceededException() {}
+ virtual const char* getName() const override { return "apache::geode::client::BufferSizeExceededException"; }
+};
/**
*@brief Thrown when a region creation operation fails.
**/
-_GF_EXCEPTION_DEF(RegionCreationFailedException);
+class CPPCACHE_EXPORT RegionCreationFailedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~RegionCreationFailedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::RegionCreationFailedException"; }
+};
/**
*@brief Thrown when there is a fatal internal exception in geode.
*/
-_GF_EXCEPTION_DEF(FatalInternalException);
+class CPPCACHE_EXPORT FatalInternalException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~FatalInternalException() {}
+ virtual const char* getName() const override { return "apache::geode::client::FatalInternalException"; }
+};
/**
*@brief Thrown by the persistence manager when a write
* fails due to disk failure.
**/
-_GF_EXCEPTION_DEF(DiskFailureException);
+class CPPCACHE_EXPORT DiskFailureException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~DiskFailureException() {}
+ virtual const char* getName() const override { return "apache::geode::client::DiskFailureException"; }
+};
/**
*@brief Thrown by the persistence manager when the data
*@brief to be read from disk is corrupt.
**/
-_GF_EXCEPTION_DEF(DiskCorruptException);
+class CPPCACHE_EXPORT DiskCorruptException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~DiskCorruptException() {}
+ virtual const char* getName() const override { return "apache::geode::client::DiskCorruptException"; }
+};
/**
*@brief Thrown when persistence manager fails to initialize.
**/
-_GF_EXCEPTION_DEF(InitFailedException);
+class CPPCACHE_EXPORT InitFailedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~InitFailedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::InitFailedException"; }
+};
/**
*@brief Thrown when persistence manager fails to close properly.
**/
-_GF_EXCEPTION_DEF(ShutdownFailedException);
+class CPPCACHE_EXPORT ShutdownFailedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~ShutdownFailedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::ShutdownFailedException"; }
+};
/**
*@brief Thrown when an exception occurs on the cache server.
**/
-_GF_EXCEPTION_DEF(CacheServerException);
+ class CPPCACHE_EXPORT CacheServerException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheServerException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheServerException"; }
+};
/**
*@brief Thrown when bound of array/vector etc. is exceeded.
**/
-_GF_EXCEPTION_DEF(OutOfRangeException);
+class CPPCACHE_EXPORT OutOfRangeException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~OutOfRangeException() {}
+ virtual const char* getName() const override { return "apache::geode::client::OutOfRangeException"; }
+};
/**
*@brief Thrown when query exception occurs at the server.
**/
-_GF_EXCEPTION_DEF(QueryException);
+class CPPCACHE_EXPORT QueryException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~QueryException() {}
+ virtual const char* getName() const override { return "apache::geode::client::QueryException"; }
+};
/**
*@brief Thrown when an unknown message is received from the server.
**/
-_GF_EXCEPTION_DEF(MessageException);
+class CPPCACHE_EXPORT MessageException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~MessageException() {}
+ virtual const char* getName() const override { return "apache::geode::client::MessageException"; }
+};
/**
*@brief Thrown when a non authorized operation is done.
**/
-_GF_EXCEPTION_DEF(NotAuthorizedException);
+class CPPCACHE_EXPORT NotAuthorizedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NotAuthorizedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NotAuthorizedException"; }
+};
/**
*@brief Thrown when authentication fails.
**/
-_GF_EXCEPTION_DEF(AuthenticationFailedException);
+class CPPCACHE_EXPORT AuthenticationFailedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~AuthenticationFailedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::AuthenticationFailedException"; }
+};
/**
*@brief Thrown when no credentials are provided by client when server expects.
**/
-_GF_EXCEPTION_DEF(AuthenticationRequiredException);
+class CPPCACHE_EXPORT AuthenticationRequiredException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~AuthenticationRequiredException() {}
+ virtual const char* getName() const override { return "apache::geode::client::AuthenticationRequiredException"; }
+};
/**
*@brief Thrown when two durable connect with same Id.
**/
-_GF_EXCEPTION_DEF(DuplicateDurableClientException);
+class CPPCACHE_EXPORT DuplicateDurableClientException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~DuplicateDurableClientException() {}
+ virtual const char* getName() const override { return "apache::geode::client::DuplicateDurableClientException"; }
+};
/**
*@brief Thrown when the cache listener throws an exception.
**/
-_GF_EXCEPTION_DEF(CacheListenerException);
+class CPPCACHE_EXPORT CacheListenerException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CacheListenerException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CacheListenerException"; }
+};
/**
*@brief Thrown during continuous query execution time.
**/
-_GF_EXCEPTION_DEF(CqException);
+class CPPCACHE_EXPORT CqException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CqException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CqException"; }
+};
/**
*@brief Thrown if the Cq on which the operaion performed is closed
**/
-_GF_EXCEPTION_DEF(CqClosedException);
+class CPPCACHE_EXPORT CqClosedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CqClosedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CqClosedException"; }
+};
/**
*@brief Thrown if the Cq Query failed
**/
-_GF_EXCEPTION_DEF(CqQueryException);
+class CPPCACHE_EXPORT CqQueryException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CqQueryException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CqQueryException"; }
+};
/**
*@brief Thrown if a Cq by this name already exists on this client
**/
-_GF_EXCEPTION_DEF(CqExistsException);
+class CPPCACHE_EXPORT CqExistsException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CqExistsException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CqExistsException"; }
+};
/**
*@brief Thrown if the query doesnot meet the CQ constraints.
* E.g.:Query string should refer only one region, join not supported.
@@ -335,61 +566,121 @@ _GF_EXCEPTION_DEF(CqExistsException);
*region path.
* Bind parameters in the query are not supported for the initial release.
**/
-_GF_EXCEPTION_DEF(CqInvalidException);
+class CPPCACHE_EXPORT CqInvalidException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CqInvalidException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CqInvalidException"; }
+};
/**
*@brief Thrown if function execution failed
**/
-_GF_EXCEPTION_DEF(FunctionExecutionException);
+class CPPCACHE_EXPORT FunctionExecutionException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~FunctionExecutionException() {}
+ virtual const char* getName() const override { return "apache::geode::client::FunctionExecutionException"; }
+};
/**
*@brief Thrown if the No locators are active to reply for new connection.
**/
-_GF_EXCEPTION_DEF(NoAvailableLocatorsException);
+class CPPCACHE_EXPORT NoAvailableLocatorsException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~NoAvailableLocatorsException() {}
+ virtual const char* getName() const override { return "apache::geode::client::NoAvailableLocatorsException"; }
+};
/**
*@brief Thrown if all connections in the pool are in use.
**/
-_GF_EXCEPTION_DEF(AllConnectionsInUseException);
+class CPPCACHE_EXPORT AllConnectionsInUseException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~AllConnectionsInUseException() {}
+ virtual const char* getName() const override { return "apache::geode::client::AllConnectionsInUseException"; }
+};
/**
*@brief Thrown if Delta could not be applied.
**/
-_GF_EXCEPTION_DEF(InvalidDeltaException);
+class CPPCACHE_EXPORT InvalidDeltaException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~InvalidDeltaException() {}
+ virtual const char* getName() const override { return "apache::geode::client::InvalidDeltaException"; }
+};
/**
*@brief Thrown if a Key is not present in the region.
**/
-_GF_EXCEPTION_DEF(KeyNotFoundException);
+class CPPCACHE_EXPORT KeyNotFoundException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~KeyNotFoundException() {}
+ virtual const char* getName() const override { return "apache::geode::client::KeyNotFoundException"; }
+};
/**
* @brief This is for all Exceptions that may be thrown
* by a Geode transaction.
**/
-_GF_EXCEPTION_DEF(TransactionException);
+class CPPCACHE_EXPORT TransactionException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~TransactionException() {}
+ virtual const char* getName() const override { return "apache::geode::client::TransactionException"; }
+};
/**
* @brief The RollbackException exception indicates that either the transaction
* has been rolled back or an operation cannot complete because the
* transaction is marked for rollback only.
**/
-_GF_EXCEPTION_DEF(RollbackException);
+class CPPCACHE_EXPORT RollbackException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~RollbackException() {}
+ virtual const char* getName() const override { return "apache::geode::client::RollbackException"; }
+};
/**
* @brief Thrown when a commit fails due to a write conflict.
* @see CacheTransactionManager#commit
**/
-_GF_EXCEPTION_DEF(CommitConflictException);
+class CPPCACHE_EXPORT CommitConflictException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~CommitConflictException() {}
+ virtual const char* getName() const override { return "apache::geode::client::CommitConflictException"; }
+};
/**
* @brief Thrown when the transactional data host has shutdown or no longer has
*the data
* being modified by the transaction.
* This can be thrown while doing transactional operations or during commit.
**/
-_GF_EXCEPTION_DEF(TransactionDataNodeHasDepartedException);
+class CPPCACHE_EXPORT TransactionDataNodeHasDepartedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~TransactionDataNodeHasDepartedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::TransactionDataNodeHasDepartedException"; }
+};
/**
* @brief Thrown when a {@link RebalanceOperation} occurs concurrently with a
*transaction.
* This can be thrown while doing transactional operations or during commit.
**/
-_GF_EXCEPTION_DEF(TransactionDataRebalancedException);
+class CPPCACHE_EXPORT TransactionDataRebalancedException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~TransactionDataRebalancedException() {}
+ virtual const char* getName() const override { return "apache::geode::client::TransactionDataRebalancedException"; }
+};
/**
* @brief Thrown if putAll operation with single hop succeeded partially.
**/
-_GF_EXCEPTION_DEF(PutAllPartialResultException);
+class CPPCACHE_EXPORT PutAllPartialResultException : public Exception {
+public:
+ using Exception::Exception;
+ virtual ~PutAllPartialResultException() {}
+ virtual const char* getName() const override { return "apache::geode::client::PutAllPartialResultException"; }
+};
/**
*@brief Thrown when a version on which delta is based is different than the
diff --git a/cppcache/integration-test/BBNamingContext.cpp b/cppcache/integration-test/BBNamingContext.cpp
index d7d61c5..b73ef64 100644
--- a/cppcache/integration-test/BBNamingContext.cpp
+++ b/cppcache/integration-test/BBNamingContext.cpp
@@ -107,7 +107,7 @@ void BBNamingContextClientImpl::open() {
fflush(stdout);
m_bbc = new FwkBBClient(buf);
} catch (FwkException& e) {
- FWKEXCEPTION("create bb client encounted Exception: " << e.getMessage());
+ FWKEXCEPTION("create bb client encounted Exception: " << e.what());
} catch (...) {
FWKEXCEPTION("create bb client unknow exception\n");
}
@@ -143,7 +143,7 @@ int BBNamingContextClientImpl::rebind(const char* key, const char* value,
return 0;
}
} catch (FwkException& e) {
- FWKEXCEPTION(" rebind encounted Exception: " << e.getMessage());
+ FWKEXCEPTION(" rebind encounted Exception: " << e.what());
m_errCount++;
} catch (...) {
FWKEXCEPTION("rebind unknown exception\n");
@@ -166,7 +166,7 @@ void BBNamingContextClientImpl::dump() {
m_errCount = 0;
}
} catch (FwkException& e) {
- FWKEXCEPTION("create dump encounted Exception: " << e.getMessage());
+ FWKEXCEPTION("create dump encounted Exception: " << e.what());
m_errCount++;
} catch (...) {
FWKEXCEPTION("dump unknown exception\n");
@@ -195,7 +195,7 @@ int BBNamingContextClientImpl::resolve(const char* key, char* value,
}
return v.length() == 0 ? -1 : 0;
} catch (FwkException& e) {
- FWKEXCEPTION("create resolve encounted Exception: " << e.getMessage());
+ FWKEXCEPTION("create resolve encounted Exception: " << e.what());
m_errCount++;
} catch (...) {
FWKEXCEPTION("resolve unknown exception\n");
@@ -211,7 +211,7 @@ bool BBNamingContextClientImpl::checkValue(const std::string& k,
std::string v = m_bbc->getString(k, k1);
if (value == v) valid = true;
} catch (FwkException& e) {
- FWKEXCEPTION("create resolve encounted Exception: " << e.getMessage());
+ FWKEXCEPTION("create resolve encounted Exception: " << e.what());
} catch (...) {
FWKEXCEPTION("resolve unknown exception\n");
}
@@ -237,7 +237,7 @@ BBNamingContextServerImpl::BBNamingContextServerImpl() {
thrds = m_farm->runThreaded(m_serv, 1);
thrds = m_farm->runThreaded(m_resp, 1);
} catch (FwkException& e) {
- FWKEXCEPTION("create bb server encounted Exception: " << e.getMessage());
+ FWKEXCEPTION("create bb server encounted Exception: " << e.what());
} catch (...) {
FWKSEVERE("create bb server unknown exception\n");
}
diff --git a/cppcache/integration-test/CacheHelper.cpp b/cppcache/integration-test/CacheHelper.cpp
index 869f5d6..28c1cb1 100644
--- a/cppcache/integration-test/CacheHelper.cpp
+++ b/cppcache/integration-test/CacheHelper.cpp
@@ -162,7 +162,7 @@ CacheHelper::CacheHelper(const bool isThinclient,
m_doDisconnect = false;
} catch (const Exception& excp) {
LOG("Geode exception while creating cache, logged in following line");
- LOG(excp.getMessage());
+ LOG(excp.what());
} catch (...) {
LOG("Throwing exception while creating cache....");
}
@@ -181,7 +181,7 @@ CacheHelper::CacheHelper(const bool isThinclient,
m_doDisconnect = false;
} catch (const Exception& excp) {
LOG("Geode exception while creating cache, logged in following line");
- LOG(excp.getMessage());
+ LOG(excp.what());
} catch (...) {
LOG("Throwing exception while creating cache....");
}
@@ -205,7 +205,7 @@ CacheHelper::CacheHelper(const bool isThinclient, bool pdxIgnoreUnreadFields,
m_doDisconnect = false;
} catch (const Exception& excp) {
LOG("Geode exception while creating cache, logged in following line");
- LOG(excp.getMessage());
+ LOG(excp.what());
} catch (...) {
LOG("Throwing exception while creating cache....");
}
@@ -260,7 +260,7 @@ CacheHelper::CacheHelper(const bool isthinClient, const char* poolName,
} catch (const Exception& excp) {
LOG("Geode exception while creating cache, logged in following line");
- LOG(excp.getMessage());
+ LOG(excp.what());
} catch (...) {
LOG("Throwing exception while creating cache....");
}
@@ -306,7 +306,7 @@ void CacheHelper::disconnect(bool keepalive) {
LOG("Closing cache complete.");
} catch (Exception& ex) {
LOG("Exception thrown while closing cache: ");
- LOG(ex.getMessage());
+ LOG(ex.what());
} catch (...) {
LOG("exception throw while closing cache");
}
diff --git a/cppcache/integration-test/DeltaEx.hpp b/cppcache/integration-test/DeltaEx.hpp
index c34f2ee..8a5ffa2 100644
--- a/cppcache/integration-test/DeltaEx.hpp
+++ b/cppcache/integration-test/DeltaEx.hpp
@@ -60,7 +60,7 @@ class DeltaEx : public Cacheable, public Delta {
if (fromDeltaCount == 1) {
fromDeltaCount++;
LOG("Invalid Delta expetion thrown");
- throw InvalidDeltaException("aaa", "nnn");
+ throw InvalidDeltaException("aaannn");
}
counter += val;
fromDeltaCount++;
@@ -115,7 +115,7 @@ class PdxDeltaEx : public PdxSerializable, public Delta {
if (m_fromDeltaCount == 1) {
m_fromDeltaCount++;
LOG("Invalid Delta expetion thrown");
- throw InvalidDeltaException("aaa", "nnn");
+ throw InvalidDeltaException("aaannn");
}
m_counter += val;
m_fromDeltaCount++;
diff --git a/cppcache/integration-test/ThinClientDistOps.hpp b/cppcache/integration-test/ThinClientDistOps.hpp
index 90895b1..a0209d1 100644
--- a/cppcache/integration-test/ThinClientDistOps.hpp
+++ b/cppcache/integration-test/ThinClientDistOps.hpp
@@ -300,7 +300,7 @@ void createAndVerifyEntry(const char* name) {
LOG("Entry with null key and value created successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException& ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
/*4.create new with entry nullptr key and string value*/
@@ -308,7 +308,7 @@ void createAndVerifyEntry(const char* name) {
regPtr->create(x, "testvalue");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException& ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
/*5.create new with entry userobject cantain all cacheable type ( like
@@ -404,7 +404,7 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
try {
regPtr->create(keyPtr, valPtr);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
LOG("createEntryTwice() Clean Exit.");
return;
}
@@ -530,7 +530,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateNonexistentServerRegion_Pooled_Locator)
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -548,7 +548,7 @@ DUNIT_TASK_DEFINITION(CLIENT1,
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -758,7 +758,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
@@ -799,7 +799,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool_Sticky)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
diff --git a/cppcache/integration-test/ThinClientPutAll.hpp b/cppcache/integration-test/ThinClientPutAll.hpp
index 545b326..9d63780 100644
--- a/cppcache/integration-test/ThinClientPutAll.hpp
+++ b/cppcache/integration-test/ThinClientPutAll.hpp
@@ -713,7 +713,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThirteen)
logmsg += "expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
map0.clear();
@@ -731,7 +731,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThirteen)
logmsg += "expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
map0.clear();
diff --git a/cppcache/integration-test/ThinClientPutAllTimeout.hpp b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
index a60642b..baed705 100644
--- a/cppcache/integration-test/ThinClientPutAllTimeout.hpp
+++ b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
@@ -165,7 +165,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, testTimeoutException)
logmsg += "PutAll expected timeout exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
dunit::sleep(30000);
@@ -179,7 +179,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, testTimeoutException)
logmsg += "PutAll with CallBackArg expected timeout exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
@@ -205,11 +205,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, testWithoutTimeoutException)
logmsg += "Not expected timeout exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
} catch (const Exception& ex) {
printf("Exception while putALL :: %s : %s\n", ex.getName(),
- ex.getMessage());
+ ex.what());
}
FAIL("Something is wrong while putAll");
}
@@ -227,13 +227,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, testWithoutTimeoutWithCallBackArgException)
logmsg += "Not expected timeout exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
} catch (const Exception& ex) {
printf(
"Exception while putAllWithOneEntryTimeoutWithCallBackArg :: %s : "
"%s\n",
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
}
FAIL("Something is wrong while putAllWithOneEntryTimeoutWithCallBackArg");
}
diff --git a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
index 3ae9323..955e50c 100644
--- a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
+++ b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
@@ -697,7 +697,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyPutAllWithLongKeyAndLongValue)
logmsg += "expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
map0.clear();
@@ -716,7 +716,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyPutAllWithLongKeyAndLongValue)
logmsg += "expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
diff --git a/cppcache/integration-test/ThinClientRegex3.hpp b/cppcache/integration-test/ThinClientRegex3.hpp
index 40ae6e2..f035480 100644
--- a/cppcache/integration-test/ThinClientRegex3.hpp
+++ b/cppcache/integration-test/ThinClientRegex3.hpp
@@ -349,7 +349,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterMalformedRegex)
FAIL("Did not get expected exception!");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
LOG("RegisterMalformedRegex complete.");
@@ -366,7 +366,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterEmptyNullAndNonExistentRegex)
regPtr0->registerRegex("");
FAIL("Did not get expected exception!");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
try {
@@ -374,7 +374,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterEmptyNullAndNonExistentRegex)
regPtr1->registerRegex(nullptr);
FAIL("Did not get expected exception!");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
try {
@@ -382,7 +382,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterEmptyNullAndNonExistentRegex)
regPtr1->unregisterRegex("Non*Existent*Regex");
FAIL("Did not get expected exception!");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
LOG("RegisterEmptyNullAndNonExistentRegex complete.");
diff --git a/cppcache/integration-test/ThinClientSecurityHelper.hpp b/cppcache/integration-test/ThinClientSecurityHelper.hpp
index 72cdfe3..8cb6ffd 100644
--- a/cppcache/integration-test/ThinClientSecurityHelper.hpp
+++ b/cppcache/integration-test/ThinClientSecurityHelper.hpp
@@ -93,8 +93,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define HANDLE_CACHEWRITER_EXCEPTION \
@@ -242,7 +242,7 @@ class putThread : public ACE_Task_Base {
}
} catch (Exception& ex) {
printf("%d: %ld exception got and exception message = %s\n", pid,
- (long)thr_id, ex.getMessage());
+ (long)thr_id, ex.what());
}
}
}
diff --git a/cppcache/integration-test/ThinClientTXFailover.hpp b/cppcache/integration-test/ThinClientTXFailover.hpp
index 83fd1a7..fcfb6e7 100644
--- a/cppcache/integration-test/ThinClientTXFailover.hpp
+++ b/cppcache/integration-test/ThinClientTXFailover.hpp
@@ -380,7 +380,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
"Got expected TransactionDataNodeHasDepartedException when "
"transaction "
"delegate has gone away: %s\n",
- ex.getMessage());
+ ex.what());
}
LOG("StepSix complete.");
diff --git a/cppcache/integration-test/ThinClientTransactions.hpp b/cppcache/integration-test/ThinClientTransactions.hpp
index c8dc6aa..33b9b08 100644
--- a/cppcache/integration-test/ThinClientTransactions.hpp
+++ b/cppcache/integration-test/ThinClientTransactions.hpp
@@ -267,7 +267,7 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
try {
regPtr->create(keyPtr, valPtr);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
LOG("createEntryTwice() Clean Exit.");
return;
}
@@ -892,7 +892,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateNonexistentServerRegion_Pooled_Locator)
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -910,7 +910,7 @@ DUNIT_TASK_DEFINITION(CLIENT1,
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -1044,7 +1044,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1KeyThriceWithoutSticky)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
@@ -1085,7 +1085,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1KeyThriceWithSticky)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
diff --git a/cppcache/integration-test/ThinClientTransactionsXA.hpp b/cppcache/integration-test/ThinClientTransactionsXA.hpp
index 1b2e4f1..4e162aa 100644
--- a/cppcache/integration-test/ThinClientTransactionsXA.hpp
+++ b/cppcache/integration-test/ThinClientTransactionsXA.hpp
@@ -266,7 +266,7 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
try {
regPtr->create(keyPtr, valPtr);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
LOG("createEntryTwice() Clean Exit.");
return;
}
@@ -906,7 +906,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateNonexistentServerRegion_Pooled_Locator)
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -924,7 +924,7 @@ DUNIT_TASK_DEFINITION(CLIENT1,
printf(
"Got expected CacheServerException when performing operation "
"on a non-existent region: %s\n",
- ex.getMessage());
+ ex.what());
}
}
END_TASK_DEFINITION
@@ -1067,7 +1067,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
@@ -1108,7 +1108,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool_Sticky)
sprintf(message, "Third create on Key %s ", CREATE_TWICE_KEY);
LOG(message);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
ASSERT(false,
"Creating KEY Twice on a caching-enabled false region should be "
"allowed.");
diff --git a/cppcache/integration-test/fw_dunit.hpp b/cppcache/integration-test/fw_dunit.hpp
index f346c1d..18fdc78 100644
--- a/cppcache/integration-test/fw_dunit.hpp
+++ b/cppcache/integration-test/fw_dunit.hpp
@@ -158,8 +158,8 @@ END_TASK(validate)
#define END_TASK(y) \
} \
catch (apache::geode::client::Exception & ex) { \
- ex.printStackTrace(); \
- FAIL(ex.getMessage()); \
+ LOG(ex.getStackTrace().c_str()); \
+ FAIL(ex.what()); \
} \
catch (std::exception & ex) { \
FAIL(ex.what()); \
@@ -176,8 +176,8 @@ END_TASK(validate)
#define ENDTASK \
} \
catch (apache::geode::client::Exception & ex) { \
- ex.printStackTrace(); \
- FAIL(ex.getMessage()); \
+ LOG(ex.getStackTrace().c_str()); \
+ FAIL(ex.what()); \
} \
catch (std::exception & ex) { \
FAIL(ex.what()); \
@@ -204,8 +204,8 @@ END_TASK(validate)
#define END_TASK_DEFINITION \
} \
catch (apache::geode::client::Exception & ex) { \
- ex.printStackTrace(); \
- FAIL(ex.getMessage()); \
+ LOG(ex.getStackTrace().c_str()); \
+ FAIL(ex.what()); \
} \
catch (std::exception & ex) { \
FAIL(ex.what()); \
@@ -230,8 +230,8 @@ END_TASK(validate)
#define END_MAIN \
} \
catch (apache::geode::client::Exception & ex) { \
- ex.printStackTrace(); \
- FAIL(ex.getMessage()); \
+ LOG(ex.getStackTrace().c_str()); \
+ FAIL(ex.what()); \
} \
catch (std::exception & ex) { \
FAIL(ex.what()); \
diff --git a/cppcache/integration-test/fw_helper.hpp b/cppcache/integration-test/fw_helper.hpp
index e346888..839e263 100644
--- a/cppcache/integration-test/fw_helper.hpp
+++ b/cppcache/integration-test/fw_helper.hpp
@@ -148,7 +148,7 @@ class TestOp {
e.print();
failed.push_back(m_name);
} catch (apache::geode::client::Exception ge) {
- ge.printStackTrace();
+ fprintf(stdout, "%s\n", ge.getStackTrace().c_str());
failed.push_back(m_name);
}
}
diff --git a/cppcache/integration-test/testCache.cpp b/cppcache/integration-test/testCache.cpp
index 716cde5..c6b4606 100644
--- a/cppcache/integration-test/testCache.cpp
+++ b/cppcache/integration-test/testCache.cpp
@@ -48,7 +48,7 @@ BEGIN_TEST(CacheFunction)
try {
rAttr = attrFac.createRegionAttributes();
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, "attribute create failed");
}
if (rAttr == nullptr) {
@@ -63,7 +63,7 @@ BEGIN_TEST(CacheFunction)
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cptr.get());
cacheImpl->createRegion(regionName, rAttr, rptr);
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"attribute create failed");
}
std::cout << "create Sub Region with name=" << subRegionName1 << std::endl;
@@ -71,7 +71,7 @@ BEGIN_TEST(CacheFunction)
try {
subRptr1 = rptr->createSubregion(subRegionName1, rAttr);
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"subregion create failed");
}
std::cout << "create Sub Region with name=" << subRegionName2 << std::endl;
@@ -79,7 +79,7 @@ BEGIN_TEST(CacheFunction)
try {
subRptr2 = rptr->createSubregion(subRegionName2, rAttr);
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"subregion create failed");
}
std::cout << "create Sub Region with name=" << subRegionName21
@@ -88,7 +88,7 @@ BEGIN_TEST(CacheFunction)
try {
subRptr21 = subRptr2->createSubregion(subRegionName21, rAttr);
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"subregion create failed");
}
std::vector<std::shared_ptr<Region>> vr = rptr->subregions(true);
@@ -124,7 +124,7 @@ BEGIN_TEST(CacheFunction)
try {
region = cptr->getRegion(root.c_str());
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"getRegion");
}
if (region == nullptr) {
@@ -136,7 +136,7 @@ BEGIN_TEST(CacheFunction)
try {
region = cptr->getRegion(subRegion1.c_str());
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"getRegion");
}
if (region == nullptr) {
@@ -148,7 +148,7 @@ BEGIN_TEST(CacheFunction)
try {
region = cptr->getRegion(subRegion21.c_str());
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"getRegion");
}
if (region == nullptr) {
@@ -161,7 +161,7 @@ BEGIN_TEST(CacheFunction)
try {
region = cptr->getRegion(subRegion21.c_str());
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"getRegion");
}
if (region == nullptr) {
@@ -174,7 +174,7 @@ BEGIN_TEST(CacheFunction)
try {
region = cptr->getRegion(notExist);
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"getRegion");
}
if (region == nullptr) {
diff --git a/cppcache/integration-test/testConnect.cpp b/cppcache/integration-test/testConnect.cpp
index 236c49b..c0be8f3 100644
--- a/cppcache/integration-test/testConnect.cpp
+++ b/cppcache/integration-test/testConnect.cpp
@@ -32,7 +32,7 @@ DUNIT_TASK(s1p1, CreateRegionOne)
FAIL("Expected an exception.");
} catch (const AlreadyConnectedException& ex) {
LOG("Got expected exception.");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
cache->getDistributedSystem().disconnect();
@@ -43,7 +43,7 @@ DUNIT_TASK(s1p1, CreateRegionOne)
FAIL("Expected an exception.");
} catch (const NotConnectedException& ex) {
LOG("Got expected exception.");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
}
ENDTASK
diff --git a/cppcache/integration-test/testLogger.cpp b/cppcache/integration-test/testLogger.cpp
index f965402..9e51dab 100644
--- a/cppcache/integration-test/testLogger.cpp
+++ b/cppcache/integration-test/testLogger.cpp
@@ -108,8 +108,7 @@ BEGIN_TEST(REINIT)
Log::init(Log::Debug, "logfile1");
} catch (IllegalStateException& ex) {
printf("Got Illegal state exception while calling init again\n");
- ex.showMessage();
- printf("Exception mesage = %s\n", ex.getMessage());
+ printf("Exception mesage = %s\n", ex.what());
exceptiongot = 1;
}
ASSERT(exceptiongot == 1, "expected exceptiongot to be 1");
diff --git a/cppcache/integration-test/testOverflowPutGetSqLite.cpp b/cppcache/integration-test/testOverflowPutGetSqLite.cpp
index 29e4bd9..4ed7461 100644
--- a/cppcache/integration-test/testOverflowPutGetSqLite.cpp
+++ b/cppcache/integration-test/testOverflowPutGetSqLite.cpp
@@ -231,7 +231,7 @@ void testEntryDestroy(std::shared_ptr<Region>& regionPtr, uint32_t num) {
std::cout << "try to destroy key" << i << std::endl;
regionPtr->destroy(v.at(i));
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"entry missing");
}
}
@@ -248,7 +248,7 @@ void testEntryInvalidate(std::shared_ptr<Region>& regionPtr, uint32_t num) {
std::cout << "try to invalidate key" << i << std::endl;
regionPtr->invalidate(v.at(i));
} catch (Exception& ex) {
- std::cout << ex.getMessage() << std::endl;
+ std::cout << ex.what() << std::endl;
ASSERT(false, (char*)"entry missing");
}
}
@@ -492,7 +492,7 @@ BEGIN_TEST(OverFlowTest_SqLiteFull)
// have any specific sqlitefull exception
char buffer[1024];
sprintf(buffer, "Got expected exception %s: msg = %s", ex.getName(),
- ex.getMessage());
+ ex.what());
LOG(buffer);
}
diff --git a/cppcache/integration-test/testRegionAccessThreadSafe.cpp b/cppcache/integration-test/testRegionAccessThreadSafe.cpp
index 541e325..6954e2f 100644
--- a/cppcache/integration-test/testRegionAccessThreadSafe.cpp
+++ b/cppcache/integration-test/testRegionAccessThreadSafe.cpp
@@ -46,7 +46,7 @@ class GetRegionThread : public ACE_Task_Base {
ASSERT(m_regionCreateDone == true, "regionCreate Not Done");
}
} catch (Exception& ex) {
- LOG(ex.getMessage());
+ LOG(ex.what());
continue;
} catch (std::exception& ex) {
LOG(ex.what());
@@ -63,7 +63,7 @@ class GetRegionThread : public ACE_Task_Base {
return 0;
}
} catch (Exception& ex) {
- LOG(ex.getMessage());
+ LOG(ex.what());
} catch (std::exception& ex) {
LOG(ex.what());
} catch (...) {
diff --git a/cppcache/integration-test/testThinClientCacheableStringArray.cpp b/cppcache/integration-test/testThinClientCacheableStringArray.cpp
index b248500..ab24435 100644
--- a/cppcache/integration-test/testThinClientCacheableStringArray.cpp
+++ b/cppcache/integration-test/testThinClientCacheableStringArray.cpp
@@ -143,12 +143,12 @@ DUNIT_TASK(CLIENT1, StepThree)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
diff --git a/cppcache/integration-test/testThinClientCq.cpp b/cppcache/integration-test/testThinClientCq.cpp
index fd2a51e..758953b 100644
--- a/cppcache/integration-test/testThinClientCq.cpp
+++ b/cppcache/integration-test/testThinClientCq.cpp
@@ -410,9 +410,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
/* Test for #1026 */
{
@@ -441,8 +441,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
LOG("Testing bug #1026 Complete");
// Iterate through the rows of the query result.
} catch (const Exception& geodeExcp) {
- LOGERROR("CqQuery Geode Exception: %s", geodeExcp.getMessage());
- FAIL(geodeExcp.getMessage());
+ LOGERROR("CqQuery Geode Exception: %s", geodeExcp.what());
+ FAIL(geodeExcp.what());
}
}
@@ -589,7 +589,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
got_exception = true;
}
@@ -614,10 +614,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
auto serviceStats = qs->getCqServiceStatistics();
ASSERT(serviceStats != nullptr, "serviceStats is nullptr");
@@ -652,10 +652,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
sprintf(buf,
"numCqsActive=%d, numCqsCreated=%d, "
@@ -675,10 +675,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
sprintf(buf,
"numCqsActive=%d, numCqsCreated=%d, "
@@ -706,10 +706,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
- excp.printStackTrace();
+ excp.getStackTrace();
}
LOG("StepFour complete.");
diff --git a/cppcache/integration-test/testThinClientCqDurable.cpp b/cppcache/integration-test/testThinClientCqDurable.cpp
index 7f8d092..3b46e3f 100644
--- a/cppcache/integration-test/testThinClientCqDurable.cpp
+++ b/cppcache/integration-test/testThinClientCqDurable.cpp
@@ -404,9 +404,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
LOG("StepThree complete.");
@@ -486,9 +486,9 @@ void client1Up() {
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
try {
getHelper()->cachePtr->readyForEvents();
@@ -572,10 +572,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
std::string failmsg = "";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
LOG("StepFour complete.");
diff --git a/cppcache/integration-test/testThinClientCqFailover.cpp b/cppcache/integration-test/testThinClientCqFailover.cpp
index 7faaac9..5324f1f 100644
--- a/cppcache/integration-test/testThinClientCqFailover.cpp
+++ b/cppcache/integration-test/testThinClientCqFailover.cpp
@@ -224,12 +224,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
@@ -284,7 +284,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
cqLstner = vl[0];
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
ASSERT(false, "get listener failed");
}
@@ -371,7 +371,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
cqLstner = vl[0];
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
ASSERT(false, "get listener failed");
}
diff --git a/cppcache/integration-test/testThinClientCqHAFailover.cpp b/cppcache/integration-test/testThinClientCqHAFailover.cpp
index b520bb9..f80d2ff 100644
--- a/cppcache/integration-test/testThinClientCqHAFailover.cpp
+++ b/cppcache/integration-test/testThinClientCqHAFailover.cpp
@@ -258,12 +258,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
@@ -318,7 +318,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
cqLstner = vl[0];
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
ASSERT(false, "get listener failed");
}
@@ -405,7 +405,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
cqLstner = vl[0];
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
ASSERT(false, "get listener failed");
}
diff --git a/cppcache/integration-test/testThinClientCqIR.cpp b/cppcache/integration-test/testThinClientCqIR.cpp
index 6f79495..96c88b5 100644
--- a/cppcache/integration-test/testThinClientCqIR.cpp
+++ b/cppcache/integration-test/testThinClientCqIR.cpp
@@ -279,9 +279,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, QueryData)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
ASSERT(false, logmsg.c_str());
}
diff --git a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
index c168208..73a5a2a 100644
--- a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
@@ -555,9 +555,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
}
diff --git a/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp b/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
index 90f53a4..bbc5678 100644
--- a/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
+++ b/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
@@ -262,7 +262,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -306,7 +306,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -350,7 +350,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -386,7 +386,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -429,7 +429,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
diff --git a/cppcache/integration-test/testThinClientHAQueryFailover.cpp b/cppcache/integration-test/testThinClientHAQueryFailover.cpp
index 178ae63..6ccb1ac 100644
--- a/cppcache/integration-test/testThinClientHAQueryFailover.cpp
+++ b/cppcache/integration-test/testThinClientHAQueryFailover.cpp
@@ -254,12 +254,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
diff --git a/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp b/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
index cbe58b3..b2a442a 100644
--- a/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
+++ b/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
@@ -242,7 +242,7 @@ std::shared_ptr<CacheableString> getUString(int index) {
str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
} catch (const Exception& geodeExcp) {
- printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
+ printf("%s: %s", geodeExcp.getName(), geodeExcp.what());
FAIL("Should not have got exception.");
}
@@ -252,7 +252,7 @@ std::shared_ptr<CacheableString> getUString(int index) {
str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
} catch (const Exception& geodeExcp) {
- printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
+ printf("%s: %s", geodeExcp.getName(), geodeExcp.what());
FAIL("Should not have got exception.");
}
diff --git a/cppcache/integration-test/testThinClientInterestNotify.cpp b/cppcache/integration-test/testThinClientInterestNotify.cpp
index a191bee..52751c5 100644
--- a/cppcache/integration-test/testThinClientInterestNotify.cpp
+++ b/cppcache/integration-test/testThinClientInterestNotify.cpp
@@ -58,7 +58,7 @@ class EventListener : public CacheListener {
LOG(buf);
} catch (const Exception& excp) {
sprintf(buf, "%s: %s: %s: %s", m_name.c_str(), eventType, excp.getName(),
- excp.getMessage());
+ excp.what());
LOG(buf);
} catch (...) {
sprintf(buf, "%s: %s: unknown exception", m_name.c_str(), eventType);
diff --git a/cppcache/integration-test/testThinClientLRUExpiration.cpp b/cppcache/integration-test/testThinClientLRUExpiration.cpp
index c8569c8..fe47106 100644
--- a/cppcache/integration-test/testThinClientLRUExpiration.cpp
+++ b/cppcache/integration-test/testThinClientLRUExpiration.cpp
@@ -125,12 +125,12 @@ void ValidateDestroyRegion(const char* name) {
} catch (RegionDestroyedException& ex) {
char buffer[1024];
sprintf(buffer, "Got expected exception %s: msg = %s", ex.getName(),
- ex.getMessage());
+ ex.what());
LOG(buffer);
} catch (Exception& ex) {
char buffer[1024];
sprintf(buffer, "Got unexpected exception %s: msg = %s", ex.getName(),
- ex.getMessage());
+ ex.what());
FAIL(buffer);
}
}
@@ -242,7 +242,7 @@ void createThinClientRegion(
} catch (EntryNotFoundException& ex) {
char buffer[1024];
sprintf(buffer, "Got expected exception %s: msg = %s", ex.getName(),
- ex.getMessage());
+ ex.what());
LOG(buffer);
}
localDestroyRegion(regionName);
diff --git a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
index 7b8bf17..19b1486 100644
--- a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
+++ b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
@@ -108,7 +108,7 @@ class CallbackListener : public CacheListener {
LOGFINE("values are NOT same");
}
} catch (const ClassCastException& ex) {
- LOGFINE(" in class cast exception %s ", ex.getMessage());
+ LOGFINE(" in class cast exception %s ", ex.what());
try {
auto fromCallback =
std::dynamic_pointer_cast<CacheableString>(eventCallback);
@@ -125,7 +125,7 @@ class CallbackListener : public CacheListener {
LOGFINE("values are NOT same");
}
} catch (const ClassCastException& ex2) {
- LOGFINE(" in class cast second exception %s ", ex2.getMessage());
+ LOGFINE(" in class cast second exception %s ", ex2.what());
}
}
}
diff --git a/cppcache/integration-test/testThinClientLocatorFailover.cpp b/cppcache/integration-test/testThinClientLocatorFailover.cpp
index 0d1bb3c..a60d8cd 100644
--- a/cppcache/integration-test/testThinClientLocatorFailover.cpp
+++ b/cppcache/integration-test/testThinClientLocatorFailover.cpp
@@ -213,14 +213,14 @@ DUNIT_TASK(CLIENT1, AgainAgainFailoverC1_All)
FAIL(
"No locator exception should "
"have been raised");
- } catch (const NotConnectedException& ex) {
- ASSERT(std::dynamic_pointer_cast<NoAvailableLocatorsException>(
- ex.getCause()),
- "NotConnectedException "
- "with cause "
- "NoAvailableLocatorsExcepti"
- "on should have been "
- "raised");
+ } catch (const NoAvailableLocatorsException& ex) {
+ LOG("Caught expected NoAvailableLocatorsException.");
+ } catch (...) {
+ FAIL("NotConnectedException "
+ "with cause "
+ "NoAvailableLocatorsExcepti"
+ "on should have been "
+ "raised");
}
}
END_TASK(AgainAgainFailoverC1_All)
diff --git a/cppcache/integration-test/testThinClientMultiDS.cpp b/cppcache/integration-test/testThinClientMultiDS.cpp
index e6ee08d..4063922 100644
--- a/cppcache/integration-test/testThinClientMultiDS.cpp
+++ b/cppcache/integration-test/testThinClientMultiDS.cpp
@@ -83,7 +83,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, InitClient1_Pool)
try {
initClient();
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
}
END_TASK_DEFINITION
@@ -93,7 +93,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, InitClient2_Pool)
try {
initClient();
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
}
}
END_TASK_DEFINITION
@@ -124,7 +124,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_EndPoint)
regPtr1->put(keys[2], vals[2]);
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
}
@@ -157,7 +157,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_EndPoint)
regPtr1->put(keys[3], vals[3]);
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
@@ -176,7 +176,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_1)
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keys[0]));
ASSERT(checkPtr1 != nullptr, "checkPtr1 should not be null");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
}
@@ -198,7 +198,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_2)
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
}
@@ -294,7 +294,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_SecureEndPoint)
regPtr1->put(keys[2], vals[2]);
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
LOG("StepOne_Pool_SecureEndPoint complete.");
@@ -328,7 +328,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_SecureEndPoint)
regPtr1->put(keys[3], vals[3]);
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
@@ -347,7 +347,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_secureclient1)
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keys[0]));
ASSERT(checkPtr1 != nullptr, "checkPtr1 should not be null");
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
LOG("StepOne_secureclient1 complete.");
@@ -364,7 +364,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_secureclient2)
}
} catch (Exception& excp) {
- LOG(excp.getMessage());
+ LOG(excp.what());
ASSERT(false, "Got unexpected exception");
}
LOG("StepOne_secureclient2 complete.");
diff --git a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
index daf66f6..ebb0338 100644
--- a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
+++ b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
@@ -135,8 +135,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllOneTask)
try {
dataReg->putAll(entryMap);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: PutAll caused random exception in PutAllOneTask");
cleanProc();
@@ -169,8 +169,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllTwoTask)
try {
dataReg->putAll(entryMap);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: PutAll caused random exception in PutAllTwoTask");
cleanProc();
@@ -203,8 +203,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllThreeTask)
try {
dataReg->putAll(entryMap);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: PutAll caused random exception in PutAllThreeTask");
cleanProc();
@@ -237,8 +237,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllFourTask)
try {
dataReg->putAll(entryMap);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: PutAll caused random exception in PutAllFourTask");
cleanProc();
@@ -303,8 +303,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllOneTask)
dataReg->putAll(entryMap);
dataReg->removeAll(keys);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: RemoveAll caused random exception in PutAllOneTask");
cleanProc();
@@ -339,8 +339,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllTwoTask)
dataReg->putAll(entryMap);
dataReg->removeAll(keys);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: RemoveAll caused random exception in PutAllTwoTask");
cleanProc();
@@ -376,8 +376,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllThreeTask)
dataReg->putAll(entryMap);
dataReg->removeAll(keys);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR(
"CPPTEST: RemoveAll caused random exception in RemoveAllThreeTask");
@@ -413,8 +413,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllFourTask)
dataReg->putAll(entryMap);
dataReg->removeAll(keys);
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR(
"CPPTEST: RemoveAll caused random exception in RemoveAllFourTask");
diff --git a/cppcache/integration-test/testThinClientPRSingleHop.cpp b/cppcache/integration-test/testThinClientPRSingleHop.cpp
index b86221c..e41856f 100644
--- a/cppcache/integration-test/testThinClientPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPRSingleHop.cpp
@@ -137,7 +137,7 @@ class putThread : public ACE_Task_Base {
}
} catch (const Exception& excp) {
LOGINFO("Exception occured in put %s: %s ", excp.getName(),
- excp.getMessage());
+ excp.what());
} catch (...) {
LOG("Random Exception occured");
}
@@ -152,7 +152,7 @@ class putThread : public ACE_Task_Base {
}
} catch (const Exception& excp) {
LOGINFO("Exception occured in get %s: %s ", excp.getName(),
- excp.getMessage());
+ excp.what());
} catch (...) {
LOG("Random Exception occured");
}
@@ -166,7 +166,7 @@ class putThread : public ACE_Task_Base {
}
} catch (const Exception& excp) {
LOGINFO("Exception occured in destroy %s: %s ", excp.getName(),
- excp.getMessage());
+ excp.what());
} catch (...) {
LOG("Random Exception occured");
}
@@ -339,8 +339,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask)
// LOGINFO("CPPTEST: SINGLEHOP SUCCEEDED while putting key %s with
// hashcode %d", logmsg, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: Put caused random exception in WarmUpTask");
cleanProc();
@@ -420,8 +420,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask3)
// LOGINFO("CPPTEST: SINGLEHOP SUCCEEDED while putting key %s with
// hashcode %d", logmsg, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: Put caused random exception in WarmUpTask");
cleanProc();
@@ -531,7 +531,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForAllKeysTask)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -562,7 +562,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForAllKeysTask)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -670,7 +670,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -728,7 +728,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: Destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -790,7 +790,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -842,7 +842,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
// hashcode %d", i, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -927,7 +927,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -977,7 +977,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: Destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -1031,7 +1031,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
i, keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -1083,7 +1083,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
// hashcode %d", i, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -1127,7 +1127,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
// hashcode %d", i, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
diff --git a/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp b/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
index 250e4ab..aa4f81d 100644
--- a/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
+++ b/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
@@ -135,7 +135,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -175,7 +175,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -215,7 +215,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -251,7 +251,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -309,7 +309,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -345,7 +345,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -381,7 +381,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -414,7 +414,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -472,7 +472,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: Put caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("Put caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -508,7 +508,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: get caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("get caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -543,7 +543,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: getALL caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("getAll caused unexpected exception");
throw IllegalStateException("TEST FAIL");
@@ -576,7 +576,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
throw IllegalStateException("TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: destroy caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("destroy caused unexpected exception");
throw IllegalStateException("TEST FAIL");
diff --git a/cppcache/integration-test/testThinClientPdxTests.cpp b/cppcache/integration-test/testThinClientPdxTests.cpp
index 953b074..58c866d 100644
--- a/cppcache/integration-test/testThinClientPdxTests.cpp
+++ b/cppcache/integration-test/testThinClientPdxTests.cpp
@@ -2450,9 +2450,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, generateJavaPdxType)
std::string logmsg = "";
logmsg += ex.getName();
logmsg += ": ";
- logmsg += ex.getMessage();
+ logmsg += ex.what();
LOG(logmsg.c_str());
- ex.printStackTrace();
+ LOG(ex.getStackTrace());
LOG("exFuncNameSendException now casting to "
"UserFunctionExecutionExceptionPtr for arrayList arguement "
"exception.");
@@ -2620,9 +2620,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyDotNetPdxTypes)
std::string logmsg = "";
logmsg += ex.getName();
logmsg += ": ";
- logmsg += ex.getMessage();
+ logmsg += ex.what();
LOG(logmsg.c_str());
- ex.printStackTrace();
+ LOG(ex.getStackTrace());
LOG("exFuncNameSendException now casting to "
"UserFunctionExecutionExceptionPtr for arrayList arguement "
"exception.");
@@ -2732,9 +2732,9 @@ DUNIT_TASK_DEFINITION(CLIENT3, client3GetsV2Object)
std::string logmsg = "";
logmsg += ex.getName();
logmsg += ": ";
- logmsg += ex.getMessage();
+ logmsg += ex.what();
LOG(logmsg.c_str());
- ex.printStackTrace();
+ LOG(ex.getStackTrace());
LOG("exFuncNameSendException now casting to "
"UserFunctionExecutionExceptionPtr for arrayList arguement "
"exception.");
diff --git a/cppcache/integration-test/testThinClientPoolAttrTest.cpp b/cppcache/integration-test/testThinClientPoolAttrTest.cpp
index 369eb89..3ba5d88 100644
--- a/cppcache/integration-test/testThinClientPoolAttrTest.cpp
+++ b/cppcache/integration-test/testThinClientPoolAttrTest.cpp
@@ -240,7 +240,7 @@ DUNIT_TASK(CLIENT2, StartC2)
"MultiUser secure mode should be true for Pool");
} catch (const Exception& excp) {
LOG("Exception during client 2 XML creation");
- LOG(excp.getMessage());
+ LOG(excp.what());
}
doAttrTesting(poolName1);
}
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
index 36d3c24..ece4df9 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
@@ -993,9 +993,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
isPoolWithEndpoint = true;
@@ -1079,9 +1079,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client2OpTest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
isPoolWithEndpoint = true;
@@ -1157,7 +1157,7 @@ class putThread : public ACE_Task_Base {
std::chrono::seconds(300))
->getResult();
} catch (const TimeoutException& te) {
- LOGINFO("Timeout exception occurred %s", te.getMessage());
+ LOGINFO("Timeout exception occurred %s", te.what());
m_timeoutCount++;
} catch (const Exception&) {
LOG("Exception occurred");
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
index ec1a91d..9383985 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
@@ -228,7 +228,7 @@ class putThread : public ACE_Task_Base {
std::chrono::seconds(300))
->getResult();
} catch (const TimeoutException& te) {
- LOGINFO("Timeout exception occurred %s", te.getMessage());
+ LOGINFO("Timeout exception occurred %s", te.what());
m_timeoutCount++;
} catch (const Exception&) {
LOG("Exception occurred");
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
index 2669ec7..8988d5c 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
@@ -1125,9 +1125,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
isPoolWithEndpoint = true;
diff --git a/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
index be5ac9c..062c004 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
@@ -291,9 +291,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
isPoolWithEndpoint = true;
@@ -412,9 +412,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
isPoolWithEndpoint = true;
diff --git a/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
index dd613df..e77dfe7 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
@@ -243,9 +243,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
}
@@ -363,9 +363,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
FAIL("Function Execution Failed!");
}
}
diff --git a/cppcache/integration-test/testThinClientPoolLocator.cpp b/cppcache/integration-test/testThinClientPoolLocator.cpp
index 0a9430b..018093a 100644
--- a/cppcache/integration-test/testThinClientPoolLocator.cpp
+++ b/cppcache/integration-test/testThinClientPoolLocator.cpp
@@ -36,12 +36,10 @@ DUNIT_TASK(CLIENT1, SetupClient1_NoLocators_At_Init)
try {
createEntry(regionNames[0], keys[0], vals[0]);
- } catch (NotConnectedException& ex) {
- ASSERT(
- std::dynamic_pointer_cast<NoAvailableLocatorsException>(
- ex.getCause()),
- "NotconnectedException with cause NoAvailableLocatorsException was "
- "not thrown.");
+ } catch (NoAvailableLocatorsException& ex) {
+ LOG("Caught expected exception.");
+ } catch (...) {
+ FAIL("NoAvailableLocatorsException was not thrown.");
}
LOG("SetupClient1 complete.");
}
@@ -163,7 +161,7 @@ DUNIT_TASK(CLIENT1, AgainFailoverC1)
"got");
} catch (const Exception& excp) {
LOG(excp.getName());
- LOG(excp.getMessage());
+ LOG(excp.what());
FAIL(
"Unexpected expection - only "
"NotConnectedException expected");
@@ -194,18 +192,15 @@ DUNIT_TASK(CLIENT2, AgainFailoverC2)
updateEntry(regionNames[0], keys[1], vals[1]);
FAIL("Client Failover Should Fail");
} catch (const NotConnectedException& ex) {
- if (!std::dynamic_pointer_cast<NoAvailableLocatorsException>(
- ex.getCause())) {
- LOG(ex.getName());
- LOG(ex.getMessage());
- FAIL(
- "Unexpected expection - only "
- "NoAvailableLocatorsException "
- "expected");
- }
+ LOG(ex.getName());
+ LOG(ex.what());
+ FAIL(
+ "Unexpected expection - only "
+ "NoAvailableLocatorsException "
+ "expected");
} catch (const Exception& excp) {
LOG(excp.getName());
- LOG(excp.getMessage());
+ LOG(excp.what());
FAIL(
"Unexpected expection - only "
"NoAvailableLocatorsException "
diff --git a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
index 703fe72..e713e12 100644
--- a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
@@ -175,8 +175,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask)
// LOGINFO("CPPTEST: SINGLEHOP SUCCEEDED while putting key %s with
// hashcode %d", logmsg, (int32_t)keyPtr->hashcode());
} catch (Exception& ex) {
- LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
- FAIL(ex.getMessage());
+ LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.what());
+ FAIL(ex.what());
} catch (...) {
LOGERROR("CPPTEST: Put caused random exception in WarmUpTask");
cleanProc();
@@ -239,7 +239,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
throw IllegalStateException("putAll::TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: putAll caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("putAll caused unexpected exception");
throw IllegalStateException("putAll::TEST FAIL");
@@ -314,7 +314,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopRemoveAllForIntKeysTask)
throw IllegalStateException("removeall::TEST FAIL DUE TO EXTRA HOP");
} catch (Exception& ex) {
LOGERROR("CPPTEST: removeall caused unexpected %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
cleanProc();
FAIL("putAll caused unexpected exception");
throw IllegalStateException("removeall::TEST FAIL");
diff --git a/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp b/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
index 3761381..ba2d0f0 100644
--- a/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
+++ b/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
@@ -117,7 +117,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, InitClientCreateRegionAndRunQueries)
results = qry->execute();
FAIL("Expected a QueryException");
} catch (const QueryException& ex) {
- printf("Good expected exception: %s\n", ex.getMessage());
+ printf("Good expected exception: %s\n", ex.what());
}
// now region queries
@@ -129,7 +129,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, InitClientCreateRegionAndRunQueries)
results = reg->query(qry2Str.c_str());
FAIL("Expected a QueryException");
} catch (const QueryException& ex) {
- printf("Good expected exception: %s\n", ex.getMessage());
+ printf("Good expected exception: %s\n", ex.what());
}
LOG("StepOne complete.");
@@ -175,7 +175,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegionAndRunQueries)
results = reg->query(qry1Str.c_str());
FAIL("Expected a QueryException");
} catch (const QueryException& ex) {
- printf("Good expected exception: %s\n", ex.getMessage());
+ printf("Good expected exception: %s\n", ex.what());
}
results = reg->query(qry2Str.c_str());
ASSERT(results->size() == qh.getPositionSetSize() * qh.getPositionNumSets(),
diff --git a/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp b/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
index 2021848..001aa4e 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
@@ -189,12 +189,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, ValidateQueryExecutionAcrossServerFailure)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
diff --git a/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp b/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
index f8e4447..6a4f034 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
@@ -185,12 +185,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, ValidateQueryExecutionAcrossServerFailure)
} catch (IllegalStateException& ise) {
char isemsg[500] = {0};
ACE_OS::snprintf(isemsg, 499, "IllegalStateException: %s",
- ise.getMessage());
+ ise.what());
LOG(isemsg);
FAIL(isemsg);
} catch (Exception& excp) {
char excpmsg[500] = {0};
- ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.getMessage());
+ ACE_OS::snprintf(excpmsg, 499, "Exception: %s", excp.what());
LOG(excpmsg);
FAIL(excpmsg);
} catch (...) {
diff --git a/cppcache/integration-test/testThinClientRemoteQuerySS.cpp b/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
index a27fba9..7339d8c 100644
--- a/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
@@ -584,7 +584,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, DoQuerySSError)
FAIL(failmsg);
} catch (apache::geode::client::QueryException& ex) {
// ok, expecting an exception, do nothing
- fprintf(stdout, "Got expected exception: %s", ex.getMessage());
+ fprintf(stdout, "Got expected exception: %s", ex.what());
} catch (...) {
ASSERT(false, "Got unexpected exception");
}
diff --git a/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp b/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
index 08da6a1..f7f4db5 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
@@ -170,7 +170,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
logmsg += "First execute expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
@@ -210,7 +210,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
failmsg += "Second execute unwanted exception ";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
}
@@ -252,7 +252,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
logmsg += "Third execute expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
@@ -292,7 +292,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
failmsg += "Fourth execute unwanted exception ";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
}
@@ -344,7 +344,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSeven)
logmsg += "Fifth execute expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
@@ -395,7 +395,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
failmsg += "Sixth execute unwanted exception ";
failmsg += excp.getName();
failmsg += ": ";
- failmsg += excp.getMessage();
+ failmsg += excp.what();
LOG(failmsg.c_str());
FAIL(failmsg.c_str());
}
@@ -439,7 +439,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyNegativeValueTimeout)
logmsg += "execute expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
@@ -484,7 +484,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyLargeValueTimeout)
logmsg += "execute expected exception ";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
}
diff --git a/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp b/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
index 57b4d70..d886e4d 100644
--- a/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
+++ b/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
@@ -199,7 +199,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for empty "
"predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -209,7 +209,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -219,14 +219,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
auto results = region->query("bad predicate");
FAIL("Expected QueryException exception for wrong predicate");
} catch (QueryException ex) {
LOG("got expected QueryException exception for wrong predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
if (!doAnyErrorOccured) {
@@ -274,7 +274,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for empty "
"predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -285,7 +285,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -296,14 +296,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
bool existsValue ATTR_UNUSED = region->existsValue("bad predicate");
FAIL("Expected QueryException exception for wrong predicate");
} catch (QueryException ex) {
LOG("got expected QueryException exception for wrong predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
if (!doAnyErrorOccured) {
@@ -381,7 +381,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for empty "
"predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -392,7 +392,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
@@ -403,7 +403,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
"timeout:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
try {
auto results = std::dynamic_pointer_cast<SelectResults>(
@@ -411,7 +411,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
FAIL("Expected IllegalArgumentException exception for wrong predicate");
} catch (QueryException ex) {
LOG("got expected QueryException for wrong predicate:");
- LOG(ex.getMessage());
+ LOG(ex.what());
}
if (!doAnyErrorOccured) {
LOG("ALL QUERIES PASSED");
diff --git a/cppcache/integration-test/testThinClientRemoveOps.cpp b/cppcache/integration-test/testThinClientRemoveOps.cpp
index 9c4ba67..d151155 100644
--- a/cppcache/integration-test/testThinClientRemoveOps.cpp
+++ b/cppcache/integration-test/testThinClientRemoveOps.cpp
@@ -268,7 +268,7 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
try {
regPtr->create(keyPtr, valPtr);
} catch (const EntryExistsException& geodeExcp) {
- LOG(geodeExcp.getMessage());
+ LOG(geodeExcp.what());
LOG("createEntryTwice() Clean Exit.");
return;
}
@@ -1287,7 +1287,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
LOG("Entry with null key and value locally created successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
try {
@@ -1295,7 +1295,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
LOG("Entry with null key and value locally put successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
try {
@@ -1303,28 +1303,28 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
LOG("Entry with null key locally deleted successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
try {
regPtr0->localInvalidate(x);
LOG("Entry with null key locally invalidated successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
try {
regPtr0->localRemove(x, 1);
LOG("Entry with null key and value locally removed successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
try {
regPtr0->localRemoveEx(x);
LOG("Entry with null key locally removed if value exist successfully");
FAIL("Expected IllegalArgumentException here");
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
auto keyObject1 = std::make_shared<PdxTests::PdxType>();
@@ -1361,7 +1361,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
try {
regPtr0->localPut(keyObject1, x);
} catch (IllegalArgumentException ex) {
- LOGINFO("Expected IllegalArgumentException : %s", ex.getMessage());
+ LOGINFO("Expected IllegalArgumentException : %s", ex.what());
}
retVal = regPtr0->get(keyObject1);
ASSERT(retVal == x, "retVal and x should match.");
diff --git a/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp b/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
index 3d8c00a..d035642 100644
--- a/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
+++ b/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
@@ -92,8 +92,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
} \
catch (const apache::geode::client::Exception& other) { \
LOG("Got apache::geode::client::Exception& other "); \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define HANDLE_NOT_AUTHORIZED_EXCEPTION \
@@ -102,8 +102,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define ADMIN_CLIENT s1p1
diff --git a/cppcache/integration-test/testThinClientSecurityAuthentication.cpp b/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
index 2259f16..f3e2d4f 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
@@ -168,8 +168,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
initClientAuth(INCORRECT_CREDENTIALS);
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
try {
@@ -177,11 +177,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("StepOne Completed");
@@ -199,8 +199,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
regPtr0->containsKeyOnServer(
apache::geode::client::CacheableKey::create(keys[0]));
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
LOG("StepTwo Completed");
@@ -214,8 +214,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree)
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
}
@@ -229,8 +229,8 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
initClientAuth(NOT_PROVIDED_CREDENTIALS);
} catch (
const apache::geode::client::AuthenticationRequiredException& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
try {
@@ -238,11 +238,11 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
FAIL("Should have thrown AuthenticationRequiredException.");
} catch (
const apache::geode::client::AuthenticationRequiredException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
FAIL("Only AuthenticationRequiredException is expected");
}
LOG("StepFour Completed");
@@ -268,8 +268,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed after FailOver");
LOG("StepFive Completed");
@@ -284,8 +284,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
createEntry(regionNamesAuth[0], keys[0], vals[0]);
updateEntry(regionNamesAuth[0], keys[0], nvals[0]);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
LOG("StepSix Completed");
@@ -298,8 +298,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
initClientAuth(INCORRECT_CREDENTIALS);
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
LOG("Setting JavaConnectionPoolSize to 0 ");
CacheHelper::setJavaConnectionPoolSize(0);
@@ -310,11 +310,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("StepSeven Completed");
@@ -422,8 +422,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("StepEight Completed");
diff --git a/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp b/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
index f032935..817299d 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
@@ -177,8 +177,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
LOG(" 3");
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
}
try {
@@ -201,11 +201,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("StepOne Completed");
@@ -233,8 +233,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
LOG("StepTwo Completed");
@@ -257,8 +257,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree)
LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
}
@@ -272,8 +272,8 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
initClientAuth(NOT_PROVIDED_CREDENTIALS);
} catch (
const apache::geode::client::AuthenticationRequiredException& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
try {
@@ -290,15 +290,15 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
FAIL("Should have thrown AuthenticationRequiredException.");
} catch (
const apache::geode::client::AuthenticationRequiredException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
FAIL("Only AuthenticationRequiredException is expected");
}
LOG("StepFour Completed");
@@ -335,8 +335,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed after FailOver");
LOG("StepFive Completed");
@@ -362,8 +362,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
LOG("StepSix Completed");
@@ -376,8 +376,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
initClientAuth(INCORRECT_CREDENTIALS);
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
}
LOG("Setting JavaConnectionPoolSize to 0 ");
CacheHelper::setJavaConnectionPoolSize(0);
@@ -400,11 +400,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("StepSeven Completed");
@@ -474,8 +474,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
LOG("StepEight Completed");
}
diff --git a/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp b/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
index e71a08a..50e7876 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
@@ -138,8 +138,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, TestAuthentication)
regPtr0->containsKeyOnServer(
apache::geode::client::CacheableKey::create(keys[0]));
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
LOG("TestAuthentication Completed");
diff --git a/cppcache/integration-test/testThinClientSecurityAuthorization.cpp b/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
index fadf78b..ca816b8 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
@@ -91,8 +91,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
} \
catch (const apache::geode::client::Exception& other) { \
LOG("Got apache::geode::client::Exception& other "); \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace()); \
+ FAIL(other.what()); \
}
#define HANDLE_NOT_AUTHORIZED_EXCEPTION \
@@ -101,8 +101,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace()); \
+ FAIL(other.what()); \
}
#define ADMIN_CLIENT s1p1
diff --git a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
index 3e3a22d..824e0b9 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
@@ -95,8 +95,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
} \
catch (const apache::geode::client::Exception& other) { \
LOG("Got apache::geode::client::Exception& other "); \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define HANDLE_NOT_AUTHORIZED_EXCEPTION \
@@ -105,8 +105,8 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define ADMIN_CLIENT s1p1
@@ -294,8 +294,8 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
"multiusermode");
LOG("Success");
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace().c_str());
+ FAIL(other.what());
}
qs = virtualCache->getQueryService();
@@ -397,9 +397,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
std::string logmsg = "";
logmsg += ex.getName();
logmsg += ": ";
- logmsg += ex.getMessage();
+ logmsg += ex.what();
LOG(logmsg.c_str());
- ex.printStackTrace();
+ LOG(ex.getStackTrace().c_str());
FAIL(
"exFuncNameSendException casting to string for bool arguement "
"exception.");
@@ -434,9 +434,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
std::string logmsg = "";
logmsg += ex.getName();
logmsg += ": ";
- logmsg += ex.getMessage();
+ logmsg += ex.what();
LOG(logmsg.c_str());
- ex.printStackTrace();
+ LOG(ex.getStackTrace().c_str());
auto uFEPtr =
std::dynamic_pointer_cast<UserFunctionExecutionException>(
result->operator[](i));
diff --git a/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
index 599b26d..713f0f1 100644
--- a/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
@@ -303,9 +303,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace());
}
LOG("StepThree complete.");
diff --git a/cppcache/integration-test/testThinClientSecurityDH.cpp b/cppcache/integration-test/testThinClientSecurityDH.cpp
index e46cc81..babbe52 100644
--- a/cppcache/integration-test/testThinClientSecurityDH.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDH.cpp
@@ -151,19 +151,19 @@ void InitIncorrectClients(const char* dhAlgo) {
try {
initClientAuth(INCORRECT_CREDENTIALS, dhAlgo);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
FAIL("Should have thrown AuthenticationFailedException.");
} catch (const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("InitIncorrectClients Completed");
@@ -173,16 +173,16 @@ void InitCorrectClients(const char* dhAlgo) {
try {
initClientAuth(CORRECT_CREDENTIALS, dhAlgo);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
createEntry(regionNamesAuth[0], keys[0], vals[0]);
updateEntry(regionNamesAuth[0], keys[0], nvals[0]);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
}
@@ -204,8 +204,8 @@ void DoNetSearch() {
LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed after FailOver");
}
diff --git a/cppcache/integration-test/testThinClientSecurityDH_MU.cpp b/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
index 8dc1555..02c911a 100644
--- a/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
@@ -157,8 +157,8 @@ void InitIncorrectClients(const char* dhAlgo) {
try {
initClientAuth(INCORRECT_CREDENTIALS, dhAlgo);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
try {
@@ -175,11 +175,11 @@ void InitIncorrectClients(const char* dhAlgo) {
}
FAIL("Should have thrown AuthenticationFailedException.");
} catch (const apache::geode::client::AuthenticationFailedException& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
FAIL("Only AuthenticationFailedException is expected");
}
LOG("InitIncorrectClients Completed");
@@ -189,8 +189,8 @@ void InitCorrectClients(const char* dhAlgo) {
try {
initClientAuth(CORRECT_CREDENTIALS, dhAlgo);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- LOG(other.getMessage());
+ LOG(other.getStackTrace());
+ LOG(other.what());
}
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr, false,
@@ -205,8 +205,8 @@ void InitCorrectClients(const char* dhAlgo) {
for (int i = 0; i < 100; i++) regionPtr->put(keys[0], vals[0]);
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed");
}
@@ -236,8 +236,8 @@ void DoNetSearch() {
LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- FAIL(other.getMessage());
+ LOG(other.getStackTrace());
+ FAIL(other.what());
}
LOG("Handshake and Authentication successfully completed after FailOver");
}
diff --git a/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
index 3bc5104..ffd9400 100644
--- a/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
@@ -331,9 +331,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
std::string logmsg = "";
logmsg += excp.getName();
logmsg += ": ";
- logmsg += excp.getMessage();
+ logmsg += excp.what();
LOG(logmsg.c_str());
- excp.printStackTrace();
+ LOG(excp.getStackTrace().c_str());
}
LOG("StepThree complete.");
diff --git a/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp b/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
index 8442dd5..5ea09bc 100644
--- a/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
+++ b/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
@@ -80,8 +80,8 @@ void initCredentialGenerator() {
} \
catch (const apache::geode::client::Exception& other) { \
LOG("Got apache::geode::client::Exception& other "); \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define HANDLE_NOT_AUTHORIZED_EXCEPTION \
@@ -90,8 +90,8 @@ void initCredentialGenerator() {
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define CLIENT_1 s1p1
@@ -168,13 +168,13 @@ const char* regionNamesAuth[] = {"DistRegionAck"};
m_failed = true;
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
+ LOG(other.getStackTrace().c_str());
m_failed = true;
char tmp[256] = {'\0'};
sprintf(tmp, "Some other geode exception got for user id = %d",
m_userId);
LOG(tmp);
- LOG(other.getMessage());
+ LOG(other.what());
m_failed = true;
} catch (...) {
m_failed = true;
@@ -210,13 +210,13 @@ const char* regionNamesAuth[] = {"DistRegionAck"};
m_failed = true;
}
} catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
+ LOG(other.getStackTrace().c_str());
m_failed = true;
char tmp[256] = {'\0'};
sprintf(tmp, "Some other geode exception got for user id = %d",
m_userId);
LOG(tmp);
- LOG(other.getMessage());
+ LOG(other.what());
m_failed = true;
} catch (...) {
m_failed = true;
diff --git a/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp b/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
index 0a3cf34..87a8acf 100644
--- a/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
+++ b/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
@@ -43,8 +43,8 @@ const char* locHostPort =
} \
catch (const apache::geode::client::Exception& other) { \
LOG("Got apache::geode::client::Exception& other "); \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define HANDLE_NOT_AUTHORIZED_EXCEPTION \
@@ -53,8 +53,8 @@ const char* locHostPort =
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace().c_str()); \
+ FAIL(other.what()); \
}
#define ADMIN_CLIENT s1p1
@@ -162,7 +162,7 @@ void checkExceptionsMap(HashMapOfException& exceptions, int clientNum,
iter->second),
"unexpected exception type in exception map");
printf("Got expected NotAuthorizedException: %s",
- iter->second->getMessage());
+ iter->second->what());
}
}
printf("Expected number of exceptions: %d; got exceptions: %zd", expectedNum,
diff --git a/cppcache/integration-test/testThinClientStatistics.cpp b/cppcache/integration-test/testThinClientStatistics.cpp
index 5165478..90837aa 100644
--- a/cppcache/integration-test/testThinClientStatistics.cpp
+++ b/cppcache/integration-test/testThinClientStatistics.cpp
@@ -192,9 +192,9 @@ void DoRegionOpsAndVerify() {
} catch (StatisticsDisabledException&) {
LOGINFO("Exception Caught:: StatisticsDisabledException");
} catch (GeodeConfigException& e) {
- LOGINFO("Exception Caught:: %s", e.getMessage());
+ LOGINFO("Exception Caught:: %s", e.what());
} catch (Exception& ex) {
- LOGINFO("Exception Caught:: %s", ex.getMessage());
+ LOGINFO("Exception Caught:: %s", ex.what());
}
if (cacheStatptr != nullptr) {
LOGINFO("LastAccessedTime = %d ", cacheStatptr->getLastAccessedTime());
diff --git a/cppcache/integration-test/testThinClientWriterException.cpp b/cppcache/integration-test/testThinClientWriterException.cpp
index de4b2a0..8afa353 100644
--- a/cppcache/integration-test/testThinClientWriterException.cpp
+++ b/cppcache/integration-test/testThinClientWriterException.cpp
@@ -88,8 +88,8 @@ opCodeList::value_type tmpRArr[] = {OP_GET, OP_REGISTER_INTEREST,
LOG("Success"); \
} \
catch (const apache::geode::client::Exception& other) { \
- other.printStackTrace(); \
- FAIL(other.getMessage()); \
+ LOG(other.getStackTrace()); \
+ FAIL(other.what()); \
}
#define HANDLE_CACHEWRITER_EXCEPTION \
diff --git a/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp b/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
index 99588dd..54256de 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
@@ -40,8 +40,8 @@ int testXmlCacheCreationWithOverflow() {
try {
cacheFactory = CacheFactory::createCacheFactory();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
@@ -54,8 +54,8 @@ int testXmlCacheCreationWithOverflow() {
cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create();
return -1;
} catch (CacheXmlException& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "CacheXmlException: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
} catch (...) {
LOGINFO("Unknown exception");
return -1;
@@ -75,8 +75,8 @@ int testXmlCacheCreationWithOverflow() {
// return 0;
} catch (Exception& ex) {
std::cout << "getPdxIgnoreUnreadFields should return true2." << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
} catch (...) {
LOGINFO(" unknown exception");
@@ -223,8 +223,8 @@ int testXmlCacheCreationWithOverflow() {
regPtr1->localDestroyRegion();
regPtr2->localDestroyRegion();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
@@ -250,8 +250,8 @@ int testXmlCacheCreationWithOverflow() {
return -1;
} catch (Exception& ex) {
std::cout << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
///////////////testing of invalid_cache1.xml completed///////////////////
@@ -269,8 +269,8 @@ int testXmlCacheCreationWithOverflow() {
return -1;
} catch (CacheXmlException& ex) {
std::cout << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "CacheXmlException: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
///////////////testing of invalid_cache2.xml completed///////////////////
@@ -289,8 +289,8 @@ int testXmlCacheCreationWithOverflow() {
return -1;
} catch (Exception& ex) {
std::cout << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
///////////////testing of invalid_cache3.xml completed///////////////////
@@ -302,8 +302,8 @@ int testXmlCacheCreationWithOverflow() {
cptr = nullptr;
}
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
std::cout << "done with test" << std::endl;
diff --git a/cppcache/integration-test/testXmlCacheCreationWithPools.cpp b/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
index 7655bec..a09d843 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
@@ -263,8 +263,8 @@ int testXmlCacheCreationWithPools() {
try {
cacheFactory = CacheFactory::createCacheFactory();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
@@ -284,8 +284,8 @@ int testXmlCacheCreationWithPools() {
std::cout << "getPdxIgnoreUnreadFields returned true." << std::endl;
}
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
} catch (...) {
LOGINFO("unknown exception");
@@ -419,8 +419,8 @@ int testXmlCacheCreationWithPools() {
return -1;
} catch (Exception& ex) {
std::cout << "EXPECTED EXCEPTION" << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
try {
@@ -432,8 +432,8 @@ int testXmlCacheCreationWithPools() {
return -1;
} catch (Exception& ex) {
std::cout << "EXPECTED EXCEPTION" << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
try {
@@ -445,8 +445,8 @@ int testXmlCacheCreationWithPools() {
return -1;
} catch (Exception& ex) {
std::cout << "EXPECTED EXCEPTION" << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
try {
@@ -458,8 +458,8 @@ int testXmlCacheCreationWithPools() {
return -1;
} catch (Exception& ex) {
std::cout << "EXPECTED EXCEPTION" << std::endl;
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
}
std::cout << "disconnecting..." << std::endl;
@@ -467,8 +467,8 @@ int testXmlCacheCreationWithPools() {
std::cout << "just before disconnecting..." << std::endl;
if (cptr != nullptr) cptr->close();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
std::cout << "done with test" << std::endl;
@@ -487,8 +487,8 @@ int testXmlDeclarativeCacheCreation() {
try {
cacheFactory = CacheFactory::createCacheFactory();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
@@ -498,8 +498,8 @@ int testXmlDeclarativeCacheCreation() {
cptr = cacheFactory->set("cache-xml-file", filePath.c_str())->create();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
} catch (...) {
LOGINFO("unknown exception");
diff --git a/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp b/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
index 74fe4ef..6d2fcc3 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
@@ -39,8 +39,8 @@ int testXmlCacheCreationWithRefid(const char* fileName) {
try {
cacheFactory = CacheFactory::createCacheFactory();
} catch (Exception& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "Exception: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
@@ -58,8 +58,8 @@ int testXmlCacheCreationWithRefid(const char* fileName) {
std::cout << "getPdxIgnoreUnreadFields returned false." << std::endl;
}
} catch (CacheXmlException& ex) {
- ex.showMessage();
- ex.printStackTrace();
+ std::cout << "CacheXmlException: msg = " << ex.what() << std::endl;
+ LOG(ex.getStackTrace());
return -1;
}
diff --git a/cppcache/src/Assert.cpp b/cppcache/src/Assert.cpp
index 6a0fdc3..6114d38 100644
--- a/cppcache/src/Assert.cpp
+++ b/cppcache/src/Assert.cpp
@@ -14,6 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#include <sstream>
+
+#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
+#include <boost/stacktrace.hpp>
#include <geode/ExceptionTypes.hpp>
#include "Assert.hpp"
#include "util/Log.hpp"
@@ -24,10 +29,11 @@ namespace client {
void Assert::throwAssertion(const char* expressionText, const char* file,
int line) {
+ AssertionException ae(expressionText);
LOGERROR("AssertionException: ( %s ) at %s:%d", expressionText, file, line);
-
- AssertionException ae(expressionText, nullptr, true);
- ae.printStackTrace();
+ std::stringstream ss;
+ ss << boost::stacktrace::stacktrace();
+ LOGERROR(ss.str().c_str());
throw ae;
}
} // namespace client
diff --git a/cppcache/src/CMakeLists.txt b/cppcache/src/CMakeLists.txt
index 29a21a1..73dc00d 100644
--- a/cppcache/src/CMakeLists.txt
+++ b/cppcache/src/CMakeLists.txt
@@ -92,6 +92,7 @@ endif()
target_link_libraries(_apache-geode INTERFACE
ACE
+ boost
libxml2
)
target_compile_definitions(_apache-geode INTERFACE
diff --git a/cppcache/src/CacheImpl.cpp b/cppcache/src/CacheImpl.cpp
index a897fec..dabf356 100644
--- a/cppcache/src/CacheImpl.cpp
+++ b/cppcache/src/CacheImpl.cpp
@@ -407,7 +407,7 @@ std::shared_ptr<RegionInternal> rpImpl = nullptr;
throw;
} catch (const Exception&) {
// LOGERROR( "Cache::createRegion: region creation failed, caught
- // exception: %s", ex.getMessage() );
+ // exception: %s", ex.what() );
// ex.printStackTrace();
throw;
} catch (std::exception& ex) {
@@ -666,7 +666,7 @@ void CacheImpl::readyForEvents() {
}
} catch (Exception& ex) {
LOGWARN("readyForEvents( ) failed for pool %s with exception: %s",
- currPool->getName(), ex.getMessage());
+ currPool->getName(), ex.what());
}
}
}
diff --git a/cppcache/src/CacheTransactionManagerImpl.cpp b/cppcache/src/CacheTransactionManagerImpl.cpp
index b1f3596..42ef64f 100644
--- a/cppcache/src/CacheTransactionManagerImpl.cpp
+++ b/cppcache/src/CacheTransactionManagerImpl.cpp
@@ -128,14 +128,14 @@ void CacheTransactionManagerImpl::commit() {
} catch(const TransactionWriterException& ex)
{
noteCommitFailure(txState, commit);
- GfErrTypeThrowException(ex.getMessage(),
+ GfErrTypeThrowException(ex.what(),
GF_COMMIT_CONFLICT_EXCEPTION);
}
catch (const Exception& ex)
{
noteCommitFailure(txState, commit);
LOGERROR("Unexpected exception during writer callback
- %s", ex.getMessage());
+ %s", ex.what());
throw ex;
}
catch (...)
@@ -190,7 +190,7 @@ Failed", GF_MSG);
catch (const Exception& ex)
{
// noteCommitFailure(txState, commit);
- LOGERROR("Unexpected exception during commit %s", ex.getMessage());
+ LOGERROR("Unexpected exception during commit %s", ex.what());
throw ex;
}
catch (...)
diff --git a/cppcache/src/CacheXmlParser.cpp b/cppcache/src/CacheXmlParser.cpp
index 02b07ee..a962763 100644
--- a/cppcache/src/CacheXmlParser.cpp
+++ b/cppcache/src/CacheXmlParser.cpp
@@ -133,15 +133,15 @@ extern "C" void startElementSAX2Function(void* ctx, const xmlChar* name,
}
} catch (const CacheXmlException& e) {
parser->setCacheXmlException();
- std::string s = e.getMessage();
+ std::string s = e.what();
parser->setError(s);
} catch (const IllegalStateException& ex) {
parser->setIllegalStateException();
- std::string s = ex.getMessage();
+ std::string s = ex.what();
parser->setError(s);
} catch (const Exception& ex) {
parser->setAnyOtherException();
- std::string s = ex.getMessage();
+ std::string s = ex.what();
parser->setError(s);
}
} // flag
@@ -204,15 +204,15 @@ extern "C" void endElementSAX2Function(void* ctx, const xmlChar* name) {
}
} catch (CacheXmlException& e) {
parser->setCacheXmlException();
- std::string s = e.getMessage();
+ std::string s = e.what();
parser->setError(s);
} catch (IllegalStateException& ex) {
parser->setIllegalStateException();
- std::string s = ex.getMessage();
+ std::string s = ex.what();
parser->setError(s);
} catch (Exception& ex) {
parser->setAnyOtherException();
- std::string s = ex.getMessage();
+ std::string s = ex.what();
parser->setError(s);
}
} // flag
@@ -1217,7 +1217,7 @@ void CacheXmlParser::startPersistenceManager(const xmlChar** atts) {
getFactoryFunc(libraryName, libraryFunctionName);
}
} catch (IllegalArgumentException& ex) {
- throw CacheXmlException(ex.getMessage());
+ throw CacheXmlException(ex.what());
}
_stack.push(std::make_shared<std::string>(std::string(libraryName)));
@@ -1343,7 +1343,7 @@ void CacheXmlParser::startCacheLoader(const xmlChar** atts) {
getFactoryFunc(libraryName, libraryFunctionName);
}
} catch (IllegalArgumentException& ex) {
- throw CacheXmlException(ex.getMessage());
+ throw CacheXmlException(ex.what());
}
auto attrsFactory = std::static_pointer_cast<AttributesFactory>(_stack.top());
@@ -1410,7 +1410,7 @@ void CacheXmlParser::startCacheListener(const xmlChar** atts) {
getFactoryFunc(libraryName, libraryFunctionName);
}
} catch (IllegalArgumentException& ex) {
- throw CacheXmlException(ex.getMessage());
+ throw CacheXmlException(ex.what());
}
auto attrsFactory = std::static_pointer_cast<AttributesFactory>(_stack.top());
@@ -1480,7 +1480,7 @@ void CacheXmlParser::startPartitionResolver(const xmlChar** atts) {
getFactoryFunc(libraryName, libraryFunctionName);
}
} catch (IllegalArgumentException& ex) {
- throw CacheXmlException(ex.getMessage());
+ throw CacheXmlException(ex.what());
}
auto attrsFactory = std::static_pointer_cast<AttributesFactory>(_stack.top());
@@ -1548,7 +1548,7 @@ void CacheXmlParser::startCacheWriter(const xmlChar** atts) {
getFactoryFunc(libraryName, libraryFunctionName);
}
} catch (IllegalArgumentException& ex) {
- throw CacheXmlException(ex.getMessage());
+ throw CacheXmlException(ex.what());
}
auto attrsFactory = std::static_pointer_cast<AttributesFactory>(_stack.top());
diff --git a/cppcache/src/CacheableObjectPartList.cpp b/cppcache/src/CacheableObjectPartList.cpp
index f8d5f05..542117e 100644
--- a/cppcache/src/CacheableObjectPartList.cpp
+++ b/cppcache/src/CacheableObjectPartList.cpp
@@ -66,11 +66,13 @@ void CacheableObjectPartList::fromData(DataInput& input) {
if (strstr(exMsg,
"org.apache.geode.security."
"NotAuthorizedException") != nullptr) {
- ex = std::make_shared<NotAuthorizedException>(
- "Authorization exception at server:", exMsg);
+ std::string message("Authorization exception at server:");
+ message += exMsg;
+ ex = std::make_shared<NotAuthorizedException>(message);
} else {
- ex = std::make_shared<CacheServerException>(
- "Exception at remote server:", exMsg);
+ std::string message("Exception at remote server:");
+ message += exMsg;
+ ex = std::make_shared<CacheServerException>(message);
}
m_exceptions->emplace(key, ex);
}
diff --git a/cppcache/src/ClientProxyMembershipIDFactory.cpp b/cppcache/src/ClientProxyMembershipIDFactory.cpp
index 18463dc..fceea5a 100644
--- a/cppcache/src/ClientProxyMembershipIDFactory.cpp
+++ b/cppcache/src/ClientProxyMembershipIDFactory.cpp
@@ -42,4 +42,4 @@ std::unique_ptr<ClientProxyMembershipID> ClientProxyMembershipIDFactory::create(
} // namespace client
} // namespace geode
-} // namespace apache
\ No newline at end of file
+} // namespace apache
diff --git a/cppcache/src/CqAttributesImpl.cpp b/cppcache/src/CqAttributesImpl.cpp
index a7ff16b..a7be4f0 100644
--- a/cppcache/src/CqAttributesImpl.cpp
+++ b/cppcache/src/CqAttributesImpl.cpp
@@ -60,7 +60,7 @@ void CqAttributesImpl::setCqListeners(
// Handle client side exceptions.
} catch (Exception& ex) {
LOGWARN("Exception occured while closing CQ Listener %s Error",
- ex.getMessage());
+ ex.what());
}
}
oldListeners.clear();
@@ -83,7 +83,7 @@ void CqAttributesImpl::removeCqListener(
cql->close();
// Handle client side exceptions.
} catch (Exception& ex) {
- LOGWARN("Exception closing CQ Listener %s Error ", ex.getMessage());
+ LOGWARN("Exception closing CQ Listener %s Error ", ex.what());
}
}
}
diff --git a/cppcache/src/CqQueryImpl.cpp b/cppcache/src/CqQueryImpl.cpp
index fab6329..0047867 100644
--- a/cppcache/src/CqQueryImpl.cpp
+++ b/cppcache/src/CqQueryImpl.cpp
@@ -160,7 +160,7 @@ void CqQueryImpl::close(bool sendRequestToServer) {
LOGWARN(
"Exception occoured in the CqListener of the CQ, CqName : "
"%sError : %s",
- m_cqName.c_str(), ex.getMessage());
+ m_cqName.c_str(), ex.what());
}
}
}
@@ -185,7 +185,7 @@ void CqQueryImpl::addToCqMap() {
} catch (Exception& ex) {
std::string errMsg =
"Failed to store Continuous Query in the repository. CqName: " +
- m_cqName + ex.getMessage();
+ m_cqName + ex.what();
LOGERROR(errMsg.c_str());
throw CqException(errMsg.c_str());
}
@@ -202,7 +202,7 @@ void CqQueryImpl::removeFromCqMap() {
} catch (Exception& ex) {
std::string errMsg =
"Failed to remove Continuous Query From the repository. CqName: " +
- m_cqName + " Error : " + ex.getMessage();
+ m_cqName + " Error : " + ex.what();
LOGERROR(errMsg.c_str());
throw CqException(errMsg.c_str());
}
@@ -349,7 +349,7 @@ bool CqQueryImpl::executeCq(TcrMessage::MsgType requestType) {
reply.getException());
if (err == GF_CACHESERVER_EXCEPTION) {
throw CqQueryException(
- "CqQuery::executeCq: exception at the server side: ",
+ std::string("CqQuery::executeCq: exception at the server side: ") +
reply.getException());
} else {
GfErrTypeToException("CqQuery::executeCq", err);
@@ -407,8 +407,8 @@ std::shared_ptr<CqResults> CqQueryImpl::executeWithInitialResults(
"CqQuery::executeCqWithInitialResults", reply.getException());
if (err == GF_CACHESERVER_EXCEPTION) {
throw CqQueryException(
- "CqQuery::executeWithInitialResults: exception "
- "at the server side: ",
+ std::string("CqQuery::executeWithInitialResults: exception ") +
+ "at the server side: " +
reply.getException());
} else {
GfErrTypeToException("CqQuery::executeWithInitialResults", err);
@@ -503,7 +503,7 @@ void CqQueryImpl::sendStopOrClose(TcrMessage::MsgType requestType) {
reply.getException());
if (err == GF_CACHESERVER_EXCEPTION) {
throw CqQueryException(
- "CqQuery::stop/close: exception at the server side: ",
+ std::string("CqQuery::stop/close: exception at the server side: ") +
reply.getException());
} else {
GfErrTypeToException("CqQuery::stop/close", err);
diff --git a/cppcache/src/CqService.cpp b/cppcache/src/CqService.cpp
index ddfe2c5..ff60bff 100644
--- a/cppcache/src/CqService.cpp
+++ b/cppcache/src/CqService.cpp
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+#include <sstream>
+
#include "CqService.hpp"
#include "ReadWriteLock.hpp"
#include <geode/DistributedSystem.hpp>
@@ -261,11 +263,11 @@ void CqService::executeCqs(query_container_type& cqs, bool afterFailover) {
}
} catch (QueryException& qe) {
LOGFINE("%s", ("Failed to execute the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
LOGFINE(("Failed to execute the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
@@ -297,11 +299,11 @@ void CqService::stopCqs(query_container_type& cqs) {
cq->stop();
} catch (QueryException& qe) {
Log::fine(("Failed to stop the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
Log::fine(("Failed to stop the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
@@ -326,11 +328,11 @@ void CqService::closeCqs(query_container_type& cqs) {
}
} catch (QueryException& qe) {
Log::fine(("Failed to close the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
Log::fine(("Failed to close the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
@@ -390,7 +392,7 @@ bool CqService::isCqExists(const std::string& cqName) {
status = (0 == m_cqQueryMap->find(cqName, tmp));
} catch (Exception& ex) {
LOGFINE("Exception (%s) in isCQExists, ignored ",
- ex.getMessage()); // Ignore.
+ ex.what()); // Ignore.
}
return status;
}
@@ -435,7 +437,7 @@ void CqService::invokeCqListeners(const std::map<std::string, int>* cqs,
cQueryImpl->close(false);
} catch (Exception& ex) {
// handle?
- LOGFINE("Exception while invoking CQ listeners: %s", ex.getMessage());
+ LOGFINE("Exception while invoking CQ listeners: %s", ex.what());
}
continue;
}
@@ -463,7 +465,7 @@ void CqService::invokeCqListeners(const std::map<std::string, int>* cqs,
// Handle client side exceptions.
} catch (Exception& ex) {
LOGWARN(("Exception in the CqListener of the CQ named " + cqName +
- ", error: " + ex.getMessage())
+ ", error: " + ex.what())
.c_str());
}
}
@@ -509,7 +511,7 @@ void CqService::invokeCqConnectedListeners(const std::string& poolName,
// Handle client side exceptions.
} catch (Exception& ex) {
LOGWARN(("Exception in the CqStatusListener of the CQ named " + cqName +
- ", error: " + ex.getMessage())
+ ", error: " + ex.what())
.c_str());
}
}
@@ -582,10 +584,11 @@ CqOperation::CqOperationType CqService::getOperation(int eventType) {
err = ThinClientRegion::handleServerException(
"CqService::getAllDurableCqsFromServer", reply.getException());
if (err == GF_CACHESERVER_EXCEPTION) {
- throw CqQueryException(
- "CqService::getAllDurableCqsFromServer: exception "
- "at the server side: ",
- reply.getException());
+ std::stringstream message;
+ message << "CqService::getAllDurableCqsFromServer: exception "
+ << "at the server side: "
+ << reply.getException();
+ throw CqQueryException(message.str());
} else {
GfErrTypeToException("CqService::getAllDurableCqsFromServer", err);
}
diff --git a/cppcache/src/DistributedSystem.cpp b/cppcache/src/DistributedSystem.cpp
index 4c02dd4..02f398d 100644
--- a/cppcache/src/DistributedSystem.cpp
+++ b/cppcache/src/DistributedSystem.cpp
@@ -159,9 +159,6 @@ std::unique_ptr<DistributedSystem> DistributedSystem::create(
auto sysProps = std::unique_ptr<SystemProperties>(
new SystemProperties(configPtr, nullptr));
- // TODO global - Refactor this to some process helper
- Exception::setStackTraces(sysProps->debugStackTraceEnabled());
-
auto name = _name;
if (name.empty()) {
name = "NativeDS";
@@ -236,9 +233,9 @@ void DistributedSystem::connect() {
m_impl->connect();
} catch (const apache::geode::client::Exception& e) {
LOGERROR("Exception caught during client initialization: %s",
- e.getMessage());
+ e.what());
std::string msg = "DistributedSystem::connect: caught exception: ";
- msg.append(e.getMessage());
+ msg.append(e.what());
throw NotConnectedException(msg.c_str());
} catch (const std::exception& e) {
LOGERROR("Exception caught during client initialization: %s", e.what());
diff --git a/cppcache/src/Exception.cpp b/cppcache/src/Exception.cpp
index b40890b..c7daa66 100644
--- a/cppcache/src/Exception.cpp
+++ b/cppcache/src/Exception.cpp
@@ -16,110 +16,39 @@
*/
#include <cstdlib>
-#include <ace/OS.h>
+#include <ace/OS.h>
#include <geode/Exception.hpp>
#include <geode/CacheableString.hpp>
#include <StackTrace.hpp>
#include <ace/TSS_T.h>
-
-#include <string>
+#include <boost/core/demangle.hpp>
namespace apache {
namespace geode {
namespace client {
-// globals can only be trusted to initialize to ZERO.
-bool Exception::s_exceptionStackTraceEnabled = false;
-
-void Exception::setStackTraces(bool stackTraceEnabled) {
- s_exceptionStackTraceEnabled = stackTraceEnabled;
+Exception::Exception(const std::string& msg)
+ : Exception(msg.c_str()) {
}
-Exception::Exception(const char* msg1, const char* msg2, bool forceTrace,
- const std::shared_ptr<Exception>& cause)
- : m_stack(), m_cause(cause) {
- size_t len1 = 0;
- if (msg1) {
- len1 = strlen(msg1);
- }
- size_t len2 = 0;
- if (msg2) {
- len2 = strlen(msg2);
- }
- size_t len = len1 + len2;
- char* msg;
- GF_NEW(msg, char[len + 1]);
- if (msg1) {
- ACE_OS::memcpy(msg, msg1, len1);
- }
- if (msg2) {
- ACE_OS::memcpy(msg + len1, msg2, len2);
- }
- msg[len] = '\0';
-
- if (s_exceptionStackTraceEnabled || forceTrace) {
- m_stack = std::make_shared<StackTrace>();
- }
- m_message = CacheableString::createNoCopy(msg, static_cast<int32_t>(len));
+Exception::Exception(const char* msg1)
+ : message(msg1) {
+ m_stack = std::unique_ptr<StackTrace>();
}
-Exception::Exception(const std::string& msg1) : Exception(msg1.c_str()) {}
-
-Exception::~Exception() {}
-
-const char _exception_name_Exception[] = "apache::geode::client::Exception";
-
-const char* Exception::getName() const { return _exception_name_Exception; }
-
-const char* Exception::getMessage() const { return m_message->asChar(); }
-
-void Exception::showMessage() const {
- printf("%s: msg = %s\n", this->getName(), m_message->asChar());
+const char *Exception::what() const noexcept {
+ return message.c_str();
}
-void Exception::printStackTrace() const {
- showMessage();
- if (m_stack == nullptr) {
- fprintf(stdout, " No stack available.\n");
- } else {
- m_stack->print();
- }
- if (m_cause != nullptr) {
- fprintf(stdout, "Cause by exception: ");
- m_cause->printStackTrace();
- }
-}
+Exception::~Exception() noexcept {}
-#ifndef _SOLARIS
-
-size_t Exception::getStackTrace(char* buffer, size_t maxLength) const {
- size_t len = 0;
- if (maxLength > 0) {
- std::string traceString;
- if (m_stack == nullptr) {
- traceString = " No stack available.\n";
- } else {
- m_stack->getString(traceString);
- }
- if (m_cause != nullptr) {
- traceString += "Cause by exception: ";
- m_cause->m_stack->getString(traceString);
- }
- len = ACE_OS::snprintf(buffer, maxLength, "%s", traceString.c_str());
- }
- return len;
+const char* Exception::getName() const {
+ return boost::core::demangle(typeid(*this).name()).c_str();
}
-#endif
-
-Exception::Exception(const std::shared_ptr<CacheableString>& message,
- const std::shared_ptr<StackTrace>& stack,
- const std::shared_ptr<Exception>& cause)
- : m_message(message), m_stack(stack), m_cause(cause) {}
-
-Exception* Exception::clone() const {
- return new Exception(m_message, m_stack, m_cause);
+std::string Exception::getStackTrace() const {
+ return m_stack ? m_stack->getString() : " No stack available.\n";
}
// class to store/clear last server exception in TSS area
diff --git a/cppcache/src/ExceptionTypes.cpp b/cppcache/src/ExceptionTypes.cpp
index 7ae4e2e..27496e9 100644
--- a/cppcache/src/ExceptionTypes.cpp
+++ b/cppcache/src/ExceptionTypes.cpp
@@ -17,6 +17,7 @@
#include <cstdio>
#include <string>
+#include <sstream>
#include <geode/ExceptionTypes.hpp>
#include <TXState.hpp>
#include <TSSTXStateWrapper.hpp>
@@ -29,6 +30,7 @@ const char* getTSSExceptionMessage();
void GfErrTypeThrowException(const char* str, GfErrType err) {
std::string func;
+ std::string message;
const char* exMsg = getTSSExceptionMessage();
if (exMsg != nullptr && exMsg[0] == '\0') {
exMsg = nullptr;
@@ -39,294 +41,298 @@ void GfErrTypeThrowException(const char* str, GfErrType err) {
}
switch (err) {
case GF_NOTCON: {
- NotConnectedException ex(
- str, (exMsg != nullptr ? exMsg : ": not connected to Geode"));
+ message.append(exMsg != nullptr ? exMsg : ": not connected to Geode");
+ NotConnectedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_MSG: {
- MessageException ex(
- str,
- (exMsg != nullptr ? exMsg
- : ": message from server could not be handled"));
+ message.append(exMsg != nullptr ? exMsg
+ : ": message from server could not be handled");
+
+ MessageException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHESERVER_EXCEPTION: {
- CacheServerException ex(
- str,
- (exMsg != nullptr ? exMsg : ": exception happened at cache server"));
+ message.append(exMsg != nullptr ? exMsg : ": exception happened at cache server");
+ CacheServerException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_NOTOWN: {
- NotOwnerException ex(str,
- (exMsg != nullptr ? exMsg : ": not own the lock"));
+ message.append(exMsg != nullptr ? exMsg : ": not own the lock");
+ NotOwnerException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_NOT_FOUND: {
- CacheServerException ex(
- str, (exMsg != nullptr ? exMsg : ": region not found on server"));
+ message.append(exMsg != nullptr ? exMsg : ": region not found on server");
+ CacheServerException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_NOT_GLOBAL: {
- IllegalStateException ex(
- str, (exMsg != nullptr ? exMsg : ": region not global"));
+ message.append(exMsg != nullptr ? exMsg : ": region not global");
+ IllegalStateException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION: {
- IllegalArgumentException ex(
- str, (exMsg != nullptr ? exMsg : ": illegal argument"));
+ message.append(exMsg != nullptr ? exMsg : ": illegal argument");
+ IllegalArgumentException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_ILLEGAL_STATE_EXCEPTION: {
- IllegalStateException ex(str,
- (exMsg != nullptr ? exMsg : ": illegal State"));
+ message.append(exMsg != nullptr ? exMsg : ": illegal State");
+ IllegalStateException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_WRITER_EXCEPTION: {
- CacheWriterException ex(
- str,
- (exMsg != nullptr ? exMsg : ": exception on server during write"));
+ message.append(exMsg != nullptr ? exMsg : ": exception on server during write");
+ CacheWriterException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHEWRITER_ERROR: {
- CacheWriterException ex(
- str, (exMsg != nullptr ? exMsg : ": exception in CacheWriter"));
+ message.append(exMsg != nullptr ? exMsg : ": exception in CacheWriter");
+ CacheWriterException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_LOADER_EXCEPTION: {
- CacheLoaderException ex(
- str, (exMsg != nullptr ? exMsg : ": exception in CacheLoader"));
+ message.append(exMsg != nullptr ? exMsg : ": exception in CacheLoader");
+ CacheLoaderException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_LISTENER_EXCEPTION: {
- CacheListenerException ex(
- str, (exMsg != nullptr ? exMsg : ": exception in CacheListener"));
+ message.append(exMsg != nullptr ? exMsg : ": exception in CacheListener");
+ CacheListenerException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_INVALID: {
- RegionDestroyedException ex(
- str, (exMsg != nullptr ? exMsg : ": region not valid"));
+ message.append(exMsg != nullptr ? exMsg : ": region not valid");
+ RegionDestroyedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_PROXY: {
- CacheProxyException ex(
- str, (exMsg != nullptr ? exMsg : ": error in Cache proxy"));
+ message.append (exMsg != nullptr ? exMsg : ": error in Cache proxy");
+ CacheProxyException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_IOERR: {
- GeodeIOException ex(
- str,
- (exMsg != nullptr ? exMsg : ": Input/Output error in operation"));
+ message.append(exMsg != nullptr ? exMsg : ": Input/Output error in operation");
+ GeodeIOException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_ENOENT: {
- NoSystemException ex(
- str, (exMsg != nullptr ? exMsg : ": entity does not exist"));
+ message.append(exMsg != nullptr ? exMsg : ": entity does not exist");
+ NoSystemException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_KEYS_NOT_STRINGS: {
- IllegalArgumentException ex(
- str, (exMsg != nullptr ? exMsg
- : ": region entries do not support C access"));
+ message.append(exMsg != nullptr ? exMsg
+ : ": region entries do not support C access");
+ IllegalArgumentException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_ENTRY_NOT_BYTES: {
- IllegalArgumentException ex(
- str, (exMsg != nullptr
+ message.append(exMsg != nullptr
? exMsg
- : ": existing non-null values was not a byte array"));
+ : ": existing non-null values was not a byte array");
+ IllegalArgumentException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_TIMEOUT_EXCEPTION: {
- TimeoutException ex(str, (exMsg != nullptr ? exMsg : ": timed out"));
+ message.append(exMsg != nullptr ? exMsg : ": timed out");
+ TimeoutException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_TIMOUT: {
- TimeoutException ex(str, (exMsg != nullptr ? exMsg : ": timed out"));
+ message.append(exMsg != nullptr ? exMsg : ": timed out");
+ TimeoutException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CLIENT_WAIT_TIMEOUT: {
- TimeoutException ex(
- str, (exMsg != nullptr
+ message.append(exMsg != nullptr
? exMsg
- : ": timed out, possibly bucket is not available."));
+ : ": timed out, possibly bucket is not available.");
+ TimeoutException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_ENOMEM: {
- OutOfMemoryException ex(str,
- (exMsg != nullptr ? exMsg : ": Out of memory"));
+ message.append(exMsg != nullptr ? exMsg : ": Out of memory");
+ OutOfMemoryException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_ERANGE: {
- BufferSizeExceededException ex(
- str, (exMsg != nullptr ? exMsg : ": Buffer Size Exceeded"));
+ message.append(exMsg != nullptr ? exMsg : ": Buffer Size Exceeded");
+ BufferSizeExceededException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_LEASE_EXPIRED_EXCEPTION: {
- LeaseExpiredException ex(
- str, (exMsg != nullptr ? exMsg : ": lock Lease Expired On you"));
+ message.append(exMsg != nullptr ? exMsg : ": lock Lease Expired On you");
+ LeaseExpiredException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_EXISTS_EXCEPTION: {
- RegionExistsException ex(
- str, (exMsg != nullptr ? exMsg : ": Named Region Exists"));
+ message.append(exMsg != nullptr ? exMsg : ": Named Region Exists");
+ RegionExistsException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_ENTRY_NOT_FOUND: {
- EntryNotFoundException ex(
- str, (exMsg != nullptr ? exMsg : ": Entry not found"));
+ message.append(exMsg != nullptr ? exMsg : ": Entry not found");
+ EntryNotFoundException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_ENTRY_EXISTS: {
- EntryExistsException ex(
- str,
- (exMsg != nullptr ? exMsg : ": Entry already exists in the region"));
+ message.append(exMsg != nullptr ? exMsg : ": Entry already exists in the region");
+ EntryExistsException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_ENTRY_DESTROYED_EXCEPTION: {
- EntryDestroyedException ex(
- str, (exMsg != nullptr ? exMsg : ": Entry has been destroyed"));
+ message.append(exMsg != nullptr ? exMsg : ": Entry has been destroyed");
+ EntryDestroyedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_REGION_DESTROYED_EXCEPTION: {
- RegionDestroyedException ex(
- str, (exMsg != nullptr ? exMsg : ": Named Region Destroyed"));
+ message.append(exMsg != nullptr ? exMsg : ": Named Region Destroyed");
+ RegionDestroyedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_CLOSED_EXCEPTION: {
- CacheClosedException ex(
- str, (exMsg != nullptr ? exMsg : ": Cache has been closed"));
+ message.append(exMsg != nullptr ? exMsg : ": Cache has been closed");
+ CacheClosedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_STATISTICS_DISABLED_EXCEPTION: {
- StatisticsDisabledException ex(
- str, (exMsg != nullptr
+ message.append(exMsg != nullptr
? exMsg
- : ": Statistics have been disabled for the region"));
+ : ": Statistics have been disabled for the region");
+ StatisticsDisabledException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_CONCURRENT_MODIFICATION_EXCEPTION: {
- ConcurrentModificationException ex(
- str, (exMsg != nullptr ? exMsg
- : ": Concurrent modification in the cache"));
+ message.append(exMsg != nullptr ? exMsg
+ : ": Concurrent modification in the cache");
+ ConcurrentModificationException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_NOT_AUTHORIZED_EXCEPTION: {
- NotAuthorizedException ex(
- str, (exMsg != nullptr ? exMsg : ": unauthorized operation"));
+ message.append(exMsg != nullptr ? exMsg : ": unauthorized operation");
+ NotAuthorizedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_AUTHENTICATION_FAILED_EXCEPTION: {
- AuthenticationFailedException ex(
- str, (exMsg != nullptr ? exMsg : ": authentication failed"));
+ message.append(exMsg != nullptr ? exMsg : ": authentication failed");
+ AuthenticationFailedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_AUTHENTICATION_REQUIRED_EXCEPTION: {
- AuthenticationRequiredException ex(
- str, (exMsg != nullptr ? exMsg : ": no authentication provided"));
+ message.append (exMsg != nullptr ? exMsg : ": no authentication provided");
+ AuthenticationRequiredException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_DUPLICATE_DURABLE_CLIENT: {
- DuplicateDurableClientException ex(
- str, (exMsg != nullptr ? exMsg : ": Duplicate Durable Client Id"));
+ message.append(exMsg != nullptr ? exMsg : ": Duplicate Durable Client Id");
+ DuplicateDurableClientException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_REMOTE_QUERY_EXCEPTION: {
- QueryException ex(str, (exMsg != nullptr ? exMsg : ": Query failed"));
+ message.append(exMsg != nullptr ? exMsg : ": Query failed");
+ QueryException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_CACHE_LOCATOR_EXCEPTION: {
- auto exCause = std::make_shared<NoAvailableLocatorsException>(
- str, (exMsg != nullptr ? exMsg : ": No locators available"));
- NotConnectedException ex(
- str, (exMsg != nullptr ? exMsg : ": No locators available"), false,
- exCause);
- setTSSExceptionMessage(nullptr);
- throw ex;
+ NoAvailableLocatorsException cause(std::string(str) +
+ (exMsg != nullptr ? exMsg : ": No locators available"));
+ setTSSExceptionMessage(nullptr);
+ try
+ {
+ throw cause;
+ } catch (...) {
+ NotConnectedException ex(std::string(str) +
+ (exMsg != nullptr ? exMsg : ": No locators available"));
+ std::throw_with_nested(ex);
+ }
}
case GF_ALL_CONNECTIONS_IN_USE_EXCEPTION: {
- AllConnectionsInUseException ex(
- str, (exMsg != nullptr ? exMsg : ": All connections are in use"));
+ message.append(exMsg != nullptr ? exMsg : ": All connections are in use");
+ AllConnectionsInUseException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_FUNCTION_EXCEPTION: {
- FunctionExecutionException ex(
- str, (exMsg != nullptr ? exMsg : ": Function execution failed"));
+ message.append(exMsg != nullptr ? exMsg : ": Function execution failed");
+ FunctionExecutionException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_DISKFULL: {
- DiskFailureException ex(str, (exMsg != nullptr ? exMsg : ": Disk full"));
+ message.append(exMsg != nullptr ? exMsg : ": Disk full");
+ DiskFailureException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_ROLLBACK_EXCEPTION: {
- RollbackException ex(
- str, (exMsg != nullptr ? exMsg : ": Transaction rolled back"));
+ message.append(exMsg != nullptr ? exMsg : ": Transaction rolled back");
+ RollbackException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_COMMIT_CONFLICT_EXCEPTION: {
- CommitConflictException ex(
- str, (exMsg != nullptr ? exMsg : ": Commit conflict exception"));
+ message.append(exMsg != nullptr ? exMsg : ": Commit conflict exception");
+ CommitConflictException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_TRANSACTION_DATA_REBALANCED_EXCEPTION: {
- TransactionDataRebalancedException ex(
- str, (exMsg != nullptr ? exMsg
- : ": Transaction data rebalanced exception"));
+ message.append(exMsg != nullptr ? exMsg
+ : ": Transaction data rebalanced exception");
+ TransactionDataRebalancedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_TRANSACTION_DATA_NODE_HAS_DEPARTED_EXCEPTION: {
- TransactionDataNodeHasDepartedException ex(
- str, (exMsg != nullptr
+ message.append(exMsg != nullptr
? exMsg
- : ": Transaction data node has departed exception"));
+ : ": Transaction data node has departed exception");
+ TransactionDataNodeHasDepartedException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
case GF_PUTALL_PARTIAL_RESULT_EXCEPTION: {
- PutAllPartialResultException ex(
- str, (exMsg != nullptr ? exMsg : ": PutAll Partial exception"));
+ message.append(exMsg != nullptr ? exMsg : ": PutAll Partial exception");
+ PutAllPartialResultException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
@@ -337,7 +343,8 @@ void GfErrTypeThrowException(const char* str, GfErrType err) {
ACE_OS::snprintf(buf, 64, "Unknown error code[0x%X]", err);
exMsg = buf;
}
- UnknownException ex(str, exMsg);
+ std::string message = std::string(str) + exMsg;
+ UnknownException ex(message);
setTSSExceptionMessage(nullptr);
throw ex;
}
diff --git a/cppcache/src/ExecutionImpl.cpp b/cppcache/src/ExecutionImpl.cpp
index e1b82d3..8741ea9 100644
--- a/cppcache/src/ExecutionImpl.cpp
+++ b/cppcache/src/ExecutionImpl.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+#include <sstream>
#include <geode/geode_globals.hpp>
#include <geode/ExceptionTypes.hpp>
#include <geode/DefaultResultCollector.hpp>
@@ -434,10 +435,9 @@ if (exceptionPtr != nullptr && err != GF_NOERR) {
if (err != GF_NOERR) {
if (err == GF_CACHESERVER_EXCEPTION) {
- throw FunctionExecutionException(
- "Execute: exception "
- "at the server side: ",
- exceptionPtr->asChar());
+ auto message = std::string("Execute: exception at the server side: ") +
+ exceptionPtr->asChar();
+ throw FunctionExecutionException(message);
} else {
LOGDEBUG("Execute errorred with server exception: %d", err);
throw FunctionExecutionException(
diff --git a/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp b/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
index 0dcc1a8..3d4b9ab 100644
--- a/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
+++ b/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
@@ -106,7 +106,7 @@ void InternalCacheTransactionManager2PCImpl::prepare() {
}
} catch (const Exception& ex) {
LOGERROR("Unexpected exception during commit in prepare %s",
- ex.getMessage());
+ ex.what());
throw ex;
}
}
@@ -207,7 +207,7 @@ void InternalCacheTransactionManager2PCImpl::afterCompletion(int32_t status) {
}
} catch (const Exception& ex) {
LOGERROR("Unexpected exception during completing transaction %s",
- ex.getMessage());
+ ex.what());
throw ex;
}
}
diff --git a/cppcache/src/LRUAction.cpp b/cppcache/src/LRUAction.cpp
index 583dd4e..c8c6cb8 100644
--- a/cppcache/src/LRUAction.cpp
+++ b/cppcache/src/LRUAction.cpp
@@ -78,10 +78,10 @@ bool LRUOverFlowToDiskAction::evict(
try {
pmPtr->write(keyPtr, valuePtr, persistenceInfo);
} catch (DiskFailureException& ex) {
- LOGERROR("DiskFailureException - %s", ex.getMessage());
+ LOGERROR("DiskFailureException - %s", ex.what());
return false;
} catch (Exception& ex) {
- LOGERROR("write to persistence layer failed - %s", ex.getMessage());
+ LOGERROR("write to persistence layer failed - %s", ex.what());
return false;
}
if (setInfo == true) {
diff --git a/cppcache/src/LRUEntriesMap.cpp b/cppcache/src/LRUEntriesMap.cpp
index bd4e0b7..1e30258 100644
--- a/cppcache/src/LRUEntriesMap.cpp
+++ b/cppcache/src/LRUEntriesMap.cpp
@@ -399,7 +399,7 @@ bool LRUEntriesMap::get(const std::shared_ptr<CacheableKey>& key,
try {
tmpObj = m_pmPtr->read(key, persistenceInfo);
} catch (Exception& ex) {
- LOGERROR("read on the persistence layer failed - %s", ex.getMessage());
+ LOGERROR("read on the persistence layer failed - %s", ex.what());
if (segmentLocked == true) segmentRPtr->release();
return false;
}
@@ -514,7 +514,7 @@ std::shared_ptr<Cacheable> LRUEntriesMap::getFromDisk(
key->toString()->asChar());
tmpObj = m_pmPtr->read(key, persistenceInfo);
} catch (Exception& ex) {
- LOGERROR("read on the persistence layer failed - %s", ex.getMessage());
+ LOGERROR("read on the persistence layer failed - %s", ex.what());
return nullptr;
}
return tmpObj;
diff --git a/cppcache/src/LocalRegion.cpp b/cppcache/src/LocalRegion.cpp
index 4ddfb73..30457bd 100644
--- a/cppcache/src/LocalRegion.cpp
+++ b/cppcache/src/LocalRegion.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+#include <sstream>
#include <vector>
#include <geode/SystemProperties.hpp>
@@ -912,7 +913,7 @@ GfErrType LocalRegion::getNoThrow(
m_regionStats->incLoaderCallsCompleted();
} catch (const Exception& ex) {
LOGERROR("Error in CacheLoader::load: %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
err = GF_CACHE_LOADER_EXCEPTION;
} catch (...) {
LOGERROR("Error in CacheLoader::load, unknown");
@@ -2559,7 +2560,7 @@ bool LocalRegion::invokeCacheWriterForEntryEvent(
} catch (const Exception& ex) {
LOGERROR("Exception in CacheWriter::%s: %s: %s", eventStr, ex.getName(),
- ex.getMessage());
+ ex.what());
bCacheWriterReturn = false;
} catch (...) {
LOGERROR("Unknown exception in CacheWriter::%s", eventStr);
@@ -2606,7 +2607,7 @@ bool LocalRegion::invokeCacheWriterForRegionEvent(
}
} catch (const Exception& ex) {
LOGERROR("Exception in CacheWriter::%s: %s", eventStr, ex.getName(),
- ex.getMessage());
+ ex.what());
bCacheWriterReturn = false;
} catch (...) {
LOGERROR("Unknown exception in CacheWriter::%s", eventStr);
@@ -2678,7 +2679,7 @@ GfErrType LocalRegion::invokeCacheListenerForEntryEvent(
} catch (const Exception& ex) {
LOGERROR("Exception in CacheListener for key[%s]::%s: %s: %s",
Utils::getCacheableKeyString(key)->asChar(), eventStr,
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
err = GF_CACHE_LISTENER_EXCEPTION;
} catch (...) {
LOGERROR("Unknown exception in CacheListener for key[%s]::%s",
@@ -2739,7 +2740,7 @@ GfErrType LocalRegion::invokeCacheListenerForRegionEvent(
}
} catch (const Exception& ex) {
LOGERROR("Exception in CacheListener::%s: %s: %s", eventStr, ex.getName(),
- ex.getMessage());
+ ex.what());
err = GF_CACHE_LISTENER_EXCEPTION;
} catch (...) {
LOGERROR("Unknown exception in CacheListener::%s", eventStr);
@@ -3101,7 +3102,7 @@ void LocalRegion::invokeAfterAllEndPointDisconnected() {
m_listener->afterRegionDisconnected(shared_from_this());
} catch (const Exception& ex) {
LOGERROR("Exception in CacheListener::afterRegionDisconnected: %s: %s",
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
} catch (...) {
LOGERROR("Unknown exception in CacheListener::afterRegionDisconnected");
}
diff --git a/cppcache/src/LocalRegion.hpp b/cppcache/src/LocalRegion.hpp
index 006a78b..abe7233 100644
--- a/cppcache/src/LocalRegion.hpp
+++ b/cppcache/src/LocalRegion.hpp
@@ -66,8 +66,9 @@ namespace client {
#define CHECK_DESTROY_PENDING(lock, function) \
lock checkGuard(m_rwLock, m_destroyPending); \
if (m_destroyPending) { \
- std::string err_msg = ": region " + m_fullPath + " destroyed"; \
- throw RegionDestroyedException(#function, err_msg.c_str()); \
+ std::string err_msg = #function; \
+ err_msg += ": region " + m_fullPath + " destroyed"; \
+ throw RegionDestroyedException(err_msg.c_str()); \
}
#endif
diff --git a/cppcache/src/Log.cpp b/cppcache/src/Log.cpp
index 2463fb2..4ebab82 100644
--- a/cppcache/src/Log.cpp
+++ b/cppcache/src/Log.cpp
@@ -705,13 +705,13 @@ void Log::put(LogLevel level, const char* msg) {
void Log::putThrow(LogLevel level, const char* msg, const Exception& ex) {
char buf[128] = {0};
ACE_OS::snprintf(buf, 128, "Geode exception %s thrown: ", ex.getName());
- put(level, (std::string(buf) + ex.getMessage() + "\n" + msg).c_str());
+ put(level, (std::string(buf) + ex.what() + "\n" + msg).c_str());
}
void Log::putCatch(LogLevel level, const char* msg, const Exception& ex) {
char buf[128] = {0};
ACE_OS::snprintf(buf, 128, "Geode exception %s caught: ", ex.getName());
- put(level, (std::string(buf) + ex.getMessage() + "\n" + msg).c_str());
+ put(level, (std::string(buf) + ex.what() + "\n" + msg).c_str());
}
void Log::enterFn(LogLevel level, const char* functionName) {
diff --git a/cppcache/src/ProxyRemoteQueryService.cpp b/cppcache/src/ProxyRemoteQueryService.cpp
index 245106e..2ca3676 100644
--- a/cppcache/src/ProxyRemoteQueryService.cpp
+++ b/cppcache/src/ProxyRemoteQueryService.cpp
@@ -117,11 +117,11 @@ void ProxyRemoteQueryService::closeCqs(bool keepAlive) {
}
} catch (QueryException& qe) {
Log::fine(("Failed to close the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
Log::fine(("Failed to close the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
@@ -158,11 +158,11 @@ void ProxyRemoteQueryService::executeCqs() {
q->execute();
} catch (QueryException& qe) {
Log::fine(("Failed to excecue the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
Log::fine(("Failed to excecue the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
@@ -177,11 +177,11 @@ void ProxyRemoteQueryService::stopCqs() {
q->stop();
} catch (QueryException& qe) {
Log::fine(("Failed to stop the CQ, CqName : " + cqName +
- " Error : " + qe.getMessage())
+ " Error : " + qe.what())
.c_str());
} catch (CqClosedException& cce) {
Log::fine(("Failed to stop the CQ, CqName : " + cqName +
- " Error : " + cce.getMessage())
+ " Error : " + cce.what())
.c_str());
}
}
diff --git a/cppcache/src/PutAllPartialResultServerException.cpp b/cppcache/src/PutAllPartialResultServerException.cpp
index d345785..374f73d 100644
--- a/cppcache/src/PutAllPartialResultServerException.cpp
+++ b/cppcache/src/PutAllPartialResultServerException.cpp
@@ -42,33 +42,38 @@ void PutAllPartialResultServerException::consolidate(
std::shared_ptr<PutAllPartialResult> otherResult) {
m_result->consolidate(otherResult);
}
+
std::shared_ptr<PutAllPartialResult>
PutAllPartialResultServerException::getResult() {
return m_result;
}
+
std::shared_ptr<VersionedCacheableObjectPartList>
PutAllPartialResultServerException::getSucceededKeysAndVersions() {
return m_result->getSucceededKeysAndVersions();
}
- std::shared_ptr<Exception> PutAllPartialResultServerException::getFailure() {
- return m_result->getFailure();
- }
-
- bool PutAllPartialResultServerException::hasFailure() {
- return m_result->hasFailure();
- }
- std::shared_ptr<CacheableKey>
- PutAllPartialResultServerException::getFirstFailedKey() {
- return m_result->getFirstFailedKey();
- }
- std::shared_ptr<CacheableString>
- PutAllPartialResultServerException::getMessage() {
- return m_result->toString();
- }
-
- void PutAllPartialResultServerException::toData(DataOutput& output) const {
- throw IllegalStateException(
- "PutAllPartialResultServerException::toData is not intended for use.");
+
+std::shared_ptr<Exception> PutAllPartialResultServerException::getFailure() {
+ return m_result->getFailure();
+}
+
+bool PutAllPartialResultServerException::hasFailure() {
+ return m_result->hasFailure();
+}
+
+std::shared_ptr<CacheableKey>
+PutAllPartialResultServerException::getFirstFailedKey() {
+ return m_result->getFirstFailedKey();
+}
+
+std::shared_ptr<CacheableString>
+PutAllPartialResultServerException::what() {
+ return m_result->toString();
+}
+
+void PutAllPartialResultServerException::toData(DataOutput& output) const {
+ throw IllegalStateException(
+ "PutAllPartialResultServerException::toData is not intended for use.");
}
void PutAllPartialResultServerException::fromData(DataInput& input) {
diff --git a/cppcache/src/PutAllPartialResultServerException.hpp b/cppcache/src/PutAllPartialResultServerException.hpp
index c225d74..5ab0d09 100644
--- a/cppcache/src/PutAllPartialResultServerException.hpp
+++ b/cppcache/src/PutAllPartialResultServerException.hpp
@@ -63,7 +63,7 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException : public Serializable {
std::shared_ptr<CacheableKey> getFirstFailedKey();
- std::shared_ptr<CacheableString> getMessage();
+ std::shared_ptr<CacheableString> what();
/**
* @brief destructor
diff --git a/cppcache/src/StackFrame.hpp b/cppcache/src/StackFrame.hpp
deleted file mode 100644
index af2fe7e..0000000
--- a/cppcache/src/StackFrame.hpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#pragma once
-
-#ifndef GEODE_STACKFRAME_H_
-#define GEODE_STACKFRAME_H_
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <cstdio>
-#include <cstdlib>
-#include <string>
-
-#include <ace/OS.h>
-
-#ifdef _WIN32
-#include <Windows.h>
-#pragma warning(push)
-#pragma warning(disable : 4091)
-#include <DbgHelp.h>
-#pragma warning(pop)
-#else
-// Since we dont compile with g++ on Sun
-#ifdef _SOLARIS
-#define DEMANGLED_SYMBOL_BUFSIZE 512
-#include <demangle.h>
-#else
-#include <exception>
-#include <cxxabi.h>
-#endif
-#endif
-
-namespace apache {
-namespace geode {
-namespace client {
-
-class StackFrame {
- public:
- char m_offset[12];
- char m_symbol[256];
- char m_module[700];
- char m_string[1024];
-
- StackFrame() {}
- char* asString();
- ~StackFrame() {}
-
-#ifdef _WIN32
-#ifndef _WIN64
- // ------------ WINDOWS -----------
-
- void init(const char* btline) {
- m_offset[0] = '\0';
- m_symbol[0] = '\0';
- m_module[0] = '\0';
- if (!UnDecorateSymbolName(btline, m_string, 1023, UNDNAME_COMPLETE)) {
- strncpy(m_string, btline, 1023);
- }
- m_string[1023] = '\0';
- }
-#endif
-#else
- // ------------ UNIX -----------
-
- void init(const char* btline) {
- m_string[0] = 0;
- int status = 0;
- char* symbol = extractSymbol(btline);
- char* demangled = nullptr;
-#ifdef _SOLARIS
- demangled = new char[DEMANGLED_SYMBOL_BUFSIZE];
- status = cplus_demangle(symbol, demangled, DEMANGLED_SYMBOL_BUFSIZE);
-#else
- demangled = abi::__cxa_demangle(symbol, 0, 0, &status);
-#endif
- if (status != 0) {
- ACE_OS::strncpy(m_symbol, symbol, sizeof(m_symbol));
- } else {
- ACE_OS::strncpy(m_symbol, demangled, sizeof(m_symbol));
- }
-#ifdef _SOLARIS
- GF_SAFE_DELETE_ARRAY(demangled);
-#else
- free(demangled);
-#endif
- delete[] symbol;
- }
-
-#endif
- // ------------ ALL -----------
-
- char* extractSymbol(const char* btline) {
- /*
- This code receives a stacktrace line in the forms:
-
- /export/hoth2/framework/lib/debug/libeventtest.so(_ZN7geode13testframework9EventTest17doEventOperationsEv+0x4a0)
- [0x93a1a0]
- /export/hoth2/framework/lib/debug/libeventtest.so(doRegionOperations+0x13d)
- [0x92c9e3]
- Client [0x804ae56]
- Client [0x804c9ca]
- /lib/tls/libc.so.6(__libc_start_main+0xda) [0xe1c79a]
- Client(_Znwj+0x41) [0x804a6ed]
-
- Sets members: m_module and m_offset
- returns the symbol
-
- */
-
- size_t btlen = strlen(btline);
- char* symbol =
- new char[btlen + 1]; // COVERTY --> 30298 Out-of-bounds access
- symbol[0] = '\0';
- m_module[0] = '\0';
- m_offset[0] = '\0';
-
- if (strchr(btline, '+')) {
- sscanf(btline, "%[^(](%[^+]+%[^)])", m_module, symbol, m_offset);
- } else {
- sscanf(btline, "%[^ ] [%[x01-9a-f]]", m_module, m_offset);
- }
- char* shortmodule = nullptr;
- if (nullptr != (shortmodule = strrchr(m_module, '/'))) {
- char* tmp =
- new char[btlen + 1]; // COVERTY --> 30298 Out-of-bounds access
- ACE_OS::strncpy(tmp, shortmodule + 1, btlen);
- ACE_OS::strncpy(m_module, tmp, btlen);
- delete[] tmp;
- }
- return symbol;
- }
-};
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_STACKFRAME_H_
diff --git a/cppcache/src/StackTrace.cpp b/cppcache/src/StackTrace.cpp
index 48d4a17..267fe9e 100644
--- a/cppcache/src/StackTrace.cpp
+++ b/cppcache/src/StackTrace.cpp
@@ -15,191 +15,23 @@
* limitations under the License.
*/
-#include "config.h"
-#include <geode/geode_globals.hpp>
#include "StackTrace.hpp"
-#include <string>
-
-// -------- Windows ----------
-
-#if defined(_WINDOWS)
-#include <Windows.h>
-#include <DbgHelp.h>
-#include "NonCopyable.hpp"
-#include <ace/OS.h>
-#include <ace/Recursive_Thread_Mutex.h>
-#include <ace/Guard_T.h>
namespace apache {
namespace geode {
namespace client {
-ACE_Recursive_Thread_Mutex lockFrame;
-StackTrace::StackTrace() {
- addFrame(m_frames);
- m_size = m_frames.size();
-}
-
-StackTrace::~StackTrace() {}
-
-void StackTrace::print() const {
- for (std::list<std::string>::const_iterator itr = m_frames.begin();
- itr != m_frames.end(); ++itr) {
- printf("%s\n", (*itr).c_str());
- }
-}
-
-void StackTrace::getString(std::string& tracestring) const {
- for (std::list<std::string>::const_iterator itr = m_frames.begin();
- itr != m_frames.end(); ++itr) {
- tracestring += *itr;
- tracestring += "\n";
- }
-}
-
-void StackTrace::addFrame(std::list<std::string>& frames) {
- ACE_Guard<ACE_Recursive_Thread_Mutex> guard(lockFrame);
- unsigned int i;
- void* stack[100];
- unsigned short framesCounts;
- SYMBOL_INFO* symbol;
- HANDLE process;
-
- process = GetCurrentProcess();
- SymInitialize(process, nullptr, TRUE);
-
- typedef USHORT(WINAPI * CaptureStackBackTraceType)(
- __in ULONG, __in ULONG, __out PVOID*, __out_opt PULONG);
- CaptureStackBackTraceType func = (CaptureStackBackTraceType)(
- GetProcAddress(LoadLibrary("kernel32.dll"), "RtlCaptureStackBackTrace"));
-
- if (!func) {
- return;
- }
- framesCounts = func(0, 62, stack, nullptr);
- symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1);
- symbol->MaxNameLen = 255;
- symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
+StackTrace::StackTrace()
+ : stacktrace(boost::stacktrace::stacktrace()) {}
- for (i = 0; i < framesCounts; i++) {
- SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol);
- m_frames.push_back(symbol->Name);
- }
- free(symbol);
-}
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#elif defined(_LINUX)
-#include <execinfo.h>
-#include <signal.h>
-#include <cstdio>
-#include <cstdlib>
-
-namespace apache {
-namespace geode {
-namespace client {
-
-StackTrace::StackTrace() {
- void* nativetrace_array[GF_TRACE_LEN];
- m_size = backtrace(nativetrace_array, GF_TRACE_LEN);
- char** symbols = backtrace_symbols(nativetrace_array, m_size);
- for (int i = 0; i < m_size; i++) {
- addFrame(symbols[i], i);
- }
- free(symbols);
-}
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#elif defined(_SOLARIS)
-#include <signal.h>
-#include <cstdio>
-#include <cstdlib>
-#include <ucontext.h>
-
-namespace apache {
-namespace geode {
-namespace client {
-StackTrace::StackTrace() {
- void* nativetrace_array[GF_TRACE_LEN];
- // NOT YET IMPLEMENTED
- /*
- ucontext_t *context;
- if ( getcontext(context) ) {
- }
- */
-}
-} // namespace client
-} // namespace geode
-} // namespace apache
-#elif defined(_MACOSX)
-#include <execinfo.h>
-
-namespace apache {
-namespace geode {
-namespace client {
-StackTrace::StackTrace() {
- void* nativetrace_array[GF_TRACE_LEN];
- m_size = backtrace(nativetrace_array, GF_TRACE_LEN);
- char** symbols = backtrace_symbols(nativetrace_array, m_size);
- for (int i = 0; i < m_size; i++) {
- addFrame(symbols[i], i);
- }
- free(symbols);
-}
-} // namespace client
-} // namespace geode
-} // namespace apache
-#else
-#error porting error
-#endif
-
-#ifndef _WIN32
-namespace apache {
-namespace geode {
-namespace client {
StackTrace::~StackTrace() {}
-void StackTrace::addFrame(const char* line, int i) { m_frames[i].init(line); }
-void StackTrace::print() const {
-#ifdef _SOLARIS
- printstack(fileno(stdout));
-#else
- std::string tracestring;
- bool last = false;
- int start = 2;
- StackTrace* self = const_cast<StackTrace*>(this);
- for (int i = start; (!last) && (i < m_size); i++) {
- tracestring += " ";
- tracestring += self->m_frames[i].asString();
- tracestring += "\n";
- if (0 == strcmp("main", m_frames[i].m_symbol)) {
- last = true;
- }
- }
- printf("%s", tracestring.c_str());
-#endif
+std::string StackTrace::getString() const {
+ std::stringstream ss;
+ ss << stacktrace;
+ return ss.str();
}
-#ifndef _SOLARIS
-void StackTrace::getString(std::string& tracestring) const {
- bool last = false;
- int start = 2;
- StackTrace* self = const_cast<StackTrace*>(this);
- for (int i = start; (!last) && (i < m_size); i++) {
- tracestring += " ";
- tracestring += self->m_frames[i].asString();
- tracestring += "\n";
- if (0 == strcmp("main", m_frames[i].m_symbol)) {
- last = true;
- }
- }
-}
-#endif
} // namespace client
} // namespace geode
} // namespace apache
-#endif
diff --git a/cppcache/src/StackTrace.hpp b/cppcache/src/StackTrace.hpp
index f403f26..ec90070 100644
--- a/cppcache/src/StackTrace.hpp
+++ b/cppcache/src/StackTrace.hpp
@@ -20,47 +20,25 @@
* limitations under the License.
*/
-#define GF_TRACE_LEN 25
-
-#include "StackFrame.hpp"
#include <memory>
#include <string>
-#include <list>
+
+#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
+#include <boost/stacktrace.hpp>
namespace apache {
namespace geode {
namespace client {
-class StackTrace;
-#ifdef _WINDOWS
class StackTrace {
public:
StackTrace();
virtual ~StackTrace();
- void print() const;
- void getString(std::string& tracestring) const;
-
- size_t m_size;
- void addFrame(std::list<std::string>& frames);
+ std::string getString() const;
private:
- std::list<std::string> m_frames;
-};
-#else
-class StackTrace {
- StackFrame m_frames[GF_TRACE_LEN];
- int m_size;
-
- public:
- StackTrace();
- virtual ~StackTrace();
- void print() const;
-#ifndef _SOLARIS
- void getString(std::string& tracestring) const;
-#endif
- void addFrame(const char* line, int i);
+ boost::stacktrace::stacktrace stacktrace;
};
-#endif
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/TXState.cpp b/cppcache/src/TXState.cpp
index c9d6090..de1b94b 100644
--- a/cppcache/src/TXState.cpp
+++ b/cppcache/src/TXState.cpp
@@ -73,7 +73,7 @@ std::shared_ptr<Cacheable> TXState::replay(bool isRollback) {
LOGFINE(
"caught exception when rolling back before retrying transaction "
"%s",
- ex.getMessage());
+ ex.what());
}
}
m_txId = std::shared_ptr<TXId>(new TXId());
@@ -86,11 +86,11 @@ std::shared_ptr<Cacheable> TXState::replay(bool isRollback) {
return result;
} catch (const TransactionDataNodeHasDepartedException& ex) {
- LOGDEBUG("Transaction exception:%s", ex.getMessage());
+ LOGDEBUG("Transaction exception:%s", ex.what());
isRollback = false;
// try again
} catch (const TransactionDataRebalancedException& ex) {
- LOGDEBUG("Transaction exception:%s", ex.getMessage());
+ LOGDEBUG("Transaction exception:%s", ex.what());
isRollback = true;
// try again
}
diff --git a/cppcache/src/TcrChunkedContext.hpp b/cppcache/src/TcrChunkedContext.hpp
index 38a24b7..6834224 100644
--- a/cppcache/src/TcrChunkedContext.hpp
+++ b/cppcache/src/TcrChunkedContext.hpp
@@ -120,7 +120,9 @@ class TcrChunkedResult {
inline bool exceptionOccurred() const { return (m_ex != nullptr); }
- inline void setException(Exception& ex) { m_ex.reset(ex.clone()); }
+ inline void setException(std::shared_ptr<Exception> ex) {
+ m_ex = ex;
+ }
inline std::shared_ptr<Exception>& getException() { return m_ex; }
};
@@ -162,14 +164,14 @@ class TcrChunkedContext {
m_result->fireHandleChunk(m_bytes, m_len, m_isLastChunkWithSecurity,
m_cache);
} catch (Exception& ex) {
- LOGERROR("HandleChunk error message %s, name = %s", ex.getMessage(),
+ LOGERROR("HandleChunk error message %s, name = %s", ex.what(),
ex.getName());
- m_result->setException(ex);
+ m_result->setException(std::make_shared<Exception>(ex));
} catch (std::exception& stdEx) {
std::string exMsg("HandleChunk exception:: ");
exMsg += stdEx.what();
LOGERROR("HandleChunk exception: %s", stdEx.what());
- UnknownException ex(exMsg.c_str());
+ auto ex = std::make_shared<UnknownException>(exMsg.c_str());
m_result->setException(ex);
} catch (...) {
std::string exMsg("Unknown exception in ");
@@ -178,7 +180,7 @@ class TcrChunkedContext {
"::handleChunk while processing response, possible serialization "
"mismatch";
LOGERROR(exMsg.c_str());
- UnknownException ex(exMsg.c_str());
+ auto ex = std::make_shared<UnknownException>(exMsg.c_str());
m_result->setException(ex);
}
}
diff --git a/cppcache/src/TcrConnection.cpp b/cppcache/src/TcrConnection.cpp
index 9a5086d..0fcfa27 100644
--- a/cppcache/src/TcrConnection.cpp
+++ b/cppcache/src/TcrConnection.cpp
@@ -48,7 +48,7 @@ const int64_t INITIAL_CONNECTION_ID = 26739;
#define throwException(ex) \
{ \
- LOGFINEST("%s: %s", ex.getName(), ex.getMessage()); \
+ LOGFINEST("%s: %s", ex.getName(), ex.what()); \
throw ex; \
}
bool TcrConnection::InitTcrConnection(
@@ -289,11 +289,11 @@ bool TcrConnection::InitTcrConnection(
throw;
} catch (const Exception& ex) {
LOGWARN("TcrConnection: failed to acquire handle to authLoader: [%s] %s",
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
+ auto message = std::string("TcrConnection: failed to load authInit library: ")
+ + ex.what();
throwException(
- AuthenticationFailedException("TcrConnection: failed "
- "to load authInit library: ",
- ex.getMessage()));
+ AuthenticationFailedException(message));
}
}
@@ -503,10 +503,10 @@ bool TcrConnection::InitTcrConnection(
case UNSUCCESSFUL_SERVER_TO_CLIENT: {
LOGERROR("Handshake rejected by server[%s]: %s",
m_endpointObj->name().c_str(), (char*)recvMessage->value());
- CacheServerException ex(
- "TcrConnection::TcrConnection: "
- "Handshake rejected by server: ",
- (char*)recvMessage->value());
+ auto message = std::string("TcrConnection::TcrConnection: ") +
+ "Handshake rejected by server: " +
+ (char*)recvMessage->value();
+ CacheServerException ex(message);
GF_SAFE_DELETE_CON(m_conn);
throw ex;
}
@@ -516,10 +516,10 @@ bool TcrConnection::InitTcrConnection(
"%s",
(*acceptanceCode)[0], m_endpointObj->name().c_str(),
recvMessage->value());
- MessageException ex(
- "TcrConnection::TcrConnection: Unknown error"
- " received from server in handshake: ",
- (char*)recvMessage->value());
+ auto message = std::string("TcrConnection::TcrConnection: Unknown error") +
+ " received from server in handshake: " +
+ (char*)recvMessage->value();
+ MessageException ex(message);
GF_SAFE_DELETE_CON(m_conn);
throw ex;
}
@@ -1119,7 +1119,7 @@ void TcrConnection::close() {
std::chrono::seconds(2), false);
}
} catch (Exception& e) {
- LOGINFO("Close connection message failed with msg: %s", e.getMessage());
+ LOGINFO("Close connection message failed with msg: %s", e.what());
} catch (...) {
LOGINFO("Close connection message failed");
}
diff --git a/cppcache/src/TcrConnectionManager.cpp b/cppcache/src/TcrConnectionManager.cpp
index c3ea897..3bc120f 100644
--- a/cppcache/src/TcrConnectionManager.cpp
+++ b/cppcache/src/TcrConnectionManager.cpp
@@ -374,7 +374,7 @@ int TcrConnectionManager::failover(volatile bool &isRunning) {
;
}
} catch (const Exception &e) {
- LOGERROR(e.getMessage());
+ LOGERROR(e.what());
} catch (const std::exception &e) {
LOGERROR(e.what());
} catch (...) {
diff --git a/cppcache/src/TcrEndpoint.cpp b/cppcache/src/TcrEndpoint.cpp
index f823e11..22853e3 100644
--- a/cppcache/src/TcrEndpoint.cpp
+++ b/cppcache/src/TcrEndpoint.cpp
@@ -37,7 +37,7 @@ namespace client {
#define throwException(ex) \
{ \
- LOGFINEST("%s: %s", ex.getName(), ex.getMessage()); \
+ LOGFINEST("%s: %s", ex.getName(), ex.what()); \
throw ex; \
}
/*
@@ -257,28 +257,28 @@ GfErrType TcrEndpoint::createNewConnection(
std::this_thread::sleep_for(std::chrono::milliseconds(50));
} catch (const GeodeIOException& ex) {
LOGINFO("IO error[%d] in handshake with endpoint[%s]: %s",
- ACE_OS::last_error(), m_name.c_str(), ex.getMessage());
+ ACE_OS::last_error(), m_name.c_str(), ex.what());
err = GF_IOERR;
m_needToConnectInLock = true; // while creating the connection
break;
} catch (const AuthenticationFailedException& ex) {
LOGWARN("Authentication failed in handshake with endpoint[%s]: %s",
- m_name.c_str(), ex.getMessage());
+ m_name.c_str(), ex.what());
err = GF_AUTHENTICATION_FAILED_EXCEPTION;
break;
} catch (const AuthenticationRequiredException& ex) {
LOGWARN("Authentication required in handshake with endpoint[%s]: %s",
- m_name.c_str(), ex.getMessage());
+ m_name.c_str(), ex.what());
err = GF_AUTHENTICATION_REQUIRED_EXCEPTION;
break;
} catch (const CacheServerException& ex) {
LOGWARN("Exception in handshake on server[%s]: %s", m_name.c_str(),
- ex.getMessage());
+ ex.what());
err = GF_CACHESERVER_EXCEPTION;
break;
} catch (const Exception& ex) {
LOGWARN("Failed in handshake with endpoint[%s]: %s", m_name.c_str(),
- ex.getMessage());
+ ex.what());
err = GF_MSG;
break;
} catch (std::exception& ex) {
@@ -718,7 +718,7 @@ int TcrEndpoint::receiveNotification(volatile bool& isRunning) {
// Endpoint is disconnected, this exception is expected
LOGFINER(
"IO exception while receiving subscription event for endpoint %s: %s",
- m_name.c_str(), e.getMessage());
+ m_name.c_str(), e.what());
if (m_connected) {
setConnectionStatus(false);
// close notification channel
@@ -734,7 +734,7 @@ int TcrEndpoint::receiveNotification(volatile bool& isRunning) {
LOGERROR(
"Exception while receiving subscription event for endpoint %s:: %s: "
"%s",
- m_name.c_str(), ex.getName(), ex.getMessage());
+ m_name.c_str(), ex.getName(), ex.what());
} catch (...) {
GF_SAFE_DELETE(msg);
LOGERROR(
@@ -1024,7 +1024,7 @@ GfErrType TcrEndpoint::sendRequestWithRetry(
error = GF_IOERR;
epFailure = true;
failReason = "IO error for endpoint";
- if (!handleIOException(ex.getMessage(), conn,
+ if (!handleIOException(ex.what(), conn,
isBgThread)) { // change here
break;
}
@@ -1032,18 +1032,14 @@ GfErrType TcrEndpoint::sendRequestWithRetry(
} catch (const Exception& ex) {
failReason = ex.getName();
failReason.append(": ");
- failReason.append(ex.getMessage());
+ failReason.append(ex.what());
LOGWARN("Error during send for endpoint %s due to %s", m_name.c_str(),
failReason.c_str());
if (compareTransactionIds(reqTransId, reply.getTransId(), failReason,
conn)) {
-#ifndef _SOLARIS
if (Log::warningEnabled()) {
- char trace[2048];
- ex.getStackTrace(trace, 2047);
- LOGWARN("Stack trace: %s", trace);
+ LOGWARN("Stack trace: %s", ex.getStackTrace().c_str());
}
-#endif
error = GF_MSG;
if (useEPPool) {
m_opConnections.put(conn, false);
diff --git a/cppcache/src/TcrMessage.cpp b/cppcache/src/TcrMessage.cpp
index 8d4f7d1..58ede7e 100644
--- a/cppcache/src/TcrMessage.cpp
+++ b/cppcache/src/TcrMessage.cpp
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include "TcrMessage.hpp"
#include <geode/CacheableBuiltins.hpp>
#include <geode/DistributedSystem.hpp>
@@ -33,6 +34,7 @@
#include "DiskStoreId.hpp"
#include "DiskVersionTag.hpp"
#include "CacheRegionHelper.hpp"
+#include <boost/stacktrace.hpp>
using namespace apache::geode::client;
static const uint32_t REGULAR_EXPRESSION =
@@ -510,7 +512,7 @@ void TcrMessage::writeObjectPart(
return;
}
} catch (const apache::geode::client::Exception& ex) {
- LOGDEBUG("Exception in writing EMPTY_BYTE_ARRAY : %s", ex.getMessage());
+ LOGDEBUG("Exception in writing EMPTY_BYTE_ARRAY : %s", ex.what());
}
isObject = 0;
}
@@ -816,7 +818,7 @@ void TcrMessage::processChunk(const uint8_t* bytes, int32_t len,
m_chunkedResult->waitFinalize();
auto ex = m_chunkedResult->getException();
if (ex != nullptr) {
- ex->raise();
+ throw *ex;
}
}
break;
@@ -847,7 +849,7 @@ void TcrMessage::processChunk(const uint8_t* bytes, int32_t len,
// of populating cache with registerAllKeys(), so that should be
// documented since rolling that back may not be a good idea either.
if (const auto& ex = m_chunkedResult->getException()) {
- ex->raise();
+ throw *ex;
}
}
} else if (TcrMessage::CQ_EXCEPTION_TYPE == m_msgType ||
@@ -1404,8 +1406,9 @@ void TcrMessage::handleByteArrayResponse(
"Unknown message type %d in response, possible serialization "
"mismatch",
m_msgType);
- StackTrace st;
- st.print();
+ std::stringstream ss;
+ ss << boost::stacktrace::stacktrace();
+ LOGERROR(ss.str().c_str());
throw MessageException("handleByteArrayResponse: unknown message type");
}
LOGDEBUG("handleByteArrayResponse earlyack = %d ", earlyack);
diff --git a/cppcache/src/ThinClientCacheDistributionManager.cpp b/cppcache/src/ThinClientCacheDistributionManager.cpp
index 9175565..0f72732 100644
--- a/cppcache/src/ThinClientCacheDistributionManager.cpp
+++ b/cppcache/src/ThinClientCacheDistributionManager.cpp
@@ -188,7 +188,7 @@ bool ThinClientCacheDistributionManager::postFailoverAction(
rqsService->executeAllCqs(true);
} catch (const Exception& excp) {
LOGWARN("Failed to recover CQs during failover attempt to endpoint[%s]: %s",
- endpoint->name().c_str(), excp.getMessage());
+ endpoint->name().c_str(), excp.what());
return false;
} catch (...) {
LOGWARN("Failed to recover CQs during failover attempt to endpoint[%s]",
diff --git a/cppcache/src/ThinClientHARegion.cpp b/cppcache/src/ThinClientHARegion.cpp
index 053ba1d..8cd4266 100644
--- a/cppcache/src/ThinClientHARegion.cpp
+++ b/cppcache/src/ThinClientHARegion.cpp
@@ -85,7 +85,7 @@ void ThinClientHARegion::initTCR() {
LOGERROR(
"ThinClientHARegion: failed to create a DistributionManager "
"object due to: %s: %s",
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
throw;
}
}
@@ -119,7 +119,7 @@ void ThinClientHARegion::handleMarker() {
m_listener->afterRegionLive(event);
} catch (const Exception& ex) {
LOGERROR("Exception in CacheListener::afterRegionLive: %s: %s",
- ex.getName(), ex.getMessage());
+ ex.getName(), ex.what());
} catch (...) {
LOGERROR("Unknown exception in CacheListener::afterRegionLive");
}
diff --git a/cppcache/src/ThinClientLocatorHelper.cpp b/cppcache/src/ThinClientLocatorHelper.cpp
index 3012b05..36649bf 100644
--- a/cppcache/src/ThinClientLocatorHelper.cpp
+++ b/cppcache/src/ThinClientLocatorHelper.cpp
@@ -143,7 +143,7 @@ GfErrType ThinClientLocatorHelper::getAllServers(
continue;
} catch (const Exception& excp) {
LOGFINE("Exception while querying locator: %s: %s", excp.getName(),
- excp.getMessage());
+ excp.what());
continue;
}
}
@@ -234,7 +234,7 @@ GfErrType ThinClientLocatorHelper::getEndpointForNewCallBackConn(
throw excp;
} catch (const Exception& excp) {
LOGFINE("Exception while querying locator: %s: %s", excp.getName(),
- excp.getMessage());
+ excp.what());
continue;
}
}
@@ -346,7 +346,7 @@ GfErrType ThinClientLocatorHelper::getEndpointForNewFwdConn(
throw excp;
} catch (const Exception& excp) {
LOGFINE("Exception while querying locator: %s: %s", excp.getName(),
- excp.getMessage());
+ excp.what());
continue;
}
}
@@ -444,7 +444,7 @@ GfErrType ThinClientLocatorHelper::updateLocators(
throw excp;
} catch (const Exception& excp) {
LOGFINE("Exception while querying locator: %s: %s", excp.getName(),
- excp.getMessage());
+ excp.what());
continue;
}
}
diff --git a/cppcache/src/ThinClientPoolDM.cpp b/cppcache/src/ThinClientPoolDM.cpp
index 94dccbb..1fd6105 100644
--- a/cppcache/src/ThinClientPoolDM.cpp
+++ b/cppcache/src/ThinClientPoolDM.cpp
@@ -539,7 +539,7 @@ int ThinClientPoolDM::manageConnectionsInternal(volatile bool& isRunning) {
getStats().setCurPoolConnections(m_poolSize);
} catch (const Exception& e) {
- LOGERROR(e.getMessage());
+ LOGERROR(e.what());
} catch (const std::exception& e) {
LOGERROR(e.what());
} catch (...) {
diff --git a/cppcache/src/ThinClientPoolRegion.cpp b/cppcache/src/ThinClientPoolRegion.cpp
index 9710913..afbcf32 100644
--- a/cppcache/src/ThinClientPoolRegion.cpp
+++ b/cppcache/src/ThinClientPoolRegion.cpp
@@ -53,7 +53,7 @@ void ThinClientPoolRegion::initTCR() {
poolDM->incRegionCount();
} catch (const Exception& ex) {
LOGERROR("Failed to initialize region due to %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
throw;
}
}
diff --git a/cppcache/src/ThinClientRedundancyManager.cpp b/cppcache/src/ThinClientRedundancyManager.cpp
index 49c6b2e..920c3ce 100644
--- a/cppcache/src/ThinClientRedundancyManager.cpp
+++ b/cppcache/src/ThinClientRedundancyManager.cpp
@@ -557,7 +557,7 @@ GfErrType ThinClientRedundancyManager::createQueueEP(TcrEndpoint* ep,
err = rqsService->executeAllCqs(ep);
} catch (const Exception& excp) {
LOGFINE("Failed to recover CQs on endpoint[%s]: %s",
- ep->name().c_str(), excp.getMessage());
+ ep->name().c_str(), excp.what());
ep->unregisterDM(true);
err = GF_NOTCON;
} catch (...) {
@@ -597,7 +597,7 @@ GfErrType ThinClientRedundancyManager::createPoolQueueEP(
err = rqsService->executeAllCqs(ep);
} catch (const Exception& excp) {
LOGFINE("Failed to recover CQs on endpoint[%s]: %s",
- ep->name().c_str(), excp.getMessage());
+ ep->name().c_str(), excp.what());
ep->unregisterDM(false); // Argument is useless
err = GF_NOTCON;
} catch (...) {
diff --git a/cppcache/src/ThinClientRegion.cpp b/cppcache/src/ThinClientRegion.cpp
index 31af5cf..d92d94a 100644
--- a/cppcache/src/ThinClientRegion.cpp
+++ b/cppcache/src/ThinClientRegion.cpp
@@ -381,7 +381,7 @@ void ThinClientRegion::initTCR() {
} catch (const Exception& ex) {
GF_SAFE_DELETE(m_tcrdm);
LOGERROR("Exception while initializing region: %s: %s", ex.getName(),
- ex.getMessage());
+ ex.what());
throw;
}
}
@@ -2943,25 +2943,15 @@ void ThinClientRegion::registerInterestGetValues(
const char* method, const std::vector<std::shared_ptr<CacheableKey>>* keys,
const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
resultKeys) {
- try {
- auto values = std::make_shared<HashMapOfCacheable>();
- auto exceptions = std::make_shared<HashMapOfException>();
- GfErrType err = getAllNoThrow_remote(keys, values, exceptions, resultKeys,
- true, nullptr);
- GfErrTypeToException(method, err);
- // log any exceptions here
- for (const auto& iter : *exceptions) {
- LOGWARN("%s Exception for key %s:: %s: %s", method,
- Utils::getCacheableKeyString(iter.first)->asChar(),
- iter.second->getName(), iter.second->getMessage());
- }
- } catch (const Exception& ex) {
- LOGWARN("%s Exception while getting values: %s: %s", method, ex.getName(),
- ex.getMessage());
- std::string msg(method);
- msg += " failed in getting values";
- throw EntryNotFoundException(msg.c_str(), nullptr, false,
- std::shared_ptr<Exception>(ex.clone()));
+ auto exceptions = std::make_shared<HashMapOfException>();
+ auto err = getAllNoThrow_remote(keys, nullptr, exceptions, resultKeys,
+ true, nullptr);
+ GfErrTypeToException(method, err);
+ // log any exceptions here
+ for (const auto& iter : *exceptions) {
+ LOGWARN("%s Exception for key %s:: %s: %s", method,
+ Utils::getCacheableKeyString(iter.first)->asChar(),
+ iter.second->getName(), iter.second->what());
}
}
diff --git a/cppcache/src/Utils.cpp b/cppcache/src/Utils.cpp
index e52968f..d3a50f3 100644
--- a/cppcache/src/Utils.cpp
+++ b/cppcache/src/Utils.cpp
@@ -225,4 +225,4 @@ void Utils::updateStatOpTime(statistics::Statistics* m_regionStats, int32_t stat
} // namespace client
} // namespace geode
-} // namespace apache
\ No newline at end of file
+} // namespace apache
diff --git a/cppcache/src/VersionedCacheableObjectPartList.cpp b/cppcache/src/VersionedCacheableObjectPartList.cpp
index aee1bd6..30e3157 100644
--- a/cppcache/src/VersionedCacheableObjectPartList.cpp
+++ b/cppcache/src/VersionedCacheableObjectPartList.cpp
@@ -56,11 +56,11 @@ void VersionedCacheableObjectPartList::readObjectPart(
if (strstr(exMsg,
"org.apache.geode.security."
"NotAuthorizedException") != nullptr) {
- ex = std::make_shared<NotAuthorizedException>(
- "Authorization exception at server:", exMsg);
+ auto message = std::string("Authorization exception at server:") + exMsg;
+ ex = std::make_shared<NotAuthorizedException>(message);
} else {
- ex = std::make_shared<CacheServerException>(
- "Exception at remote server:", exMsg);
+ auto message = std::string("Exception at remote server:") + exMsg;
+ ex = std::make_shared<CacheServerException>(message);
}
m_exceptions->emplace(keyPtr, ex);
}
diff --git a/cppcache/src/statistics/GeodeStatisticsFactory.cpp b/cppcache/src/statistics/GeodeStatisticsFactory.cpp
index 2ccac7f..56a07a1 100644
--- a/cppcache/src/statistics/GeodeStatisticsFactory.cpp
+++ b/cppcache/src/statistics/GeodeStatisticsFactory.cpp
@@ -161,10 +161,9 @@ StatisticsTypeImpl* GeodeStatisticsFactory::addType(StatisticsTypeImpl* st) {
}
if (status == 1) {
} else if (status == -1) {
- throw IllegalArgumentException(
- "GeodeStatisticsFactory::addType: failed "
- "to add new type %s",
- temp.c_str());
+ auto message = std::string("GeodeStatisticsFactory::addType: failed ") +
+ "to add new type " + temp.c_str();
+ throw IllegalArgumentException(message);
}
return st;
}
diff --git a/cppcache/src/statistics/HostStatHelperSolaris.cpp b/cppcache/src/statistics/HostStatHelperSolaris.cpp
index 30801ec..b2df4a1 100644
--- a/cppcache/src/statistics/HostStatHelperSolaris.cpp
+++ b/cppcache/src/statistics/HostStatHelperSolaris.cpp
@@ -140,7 +140,7 @@ void HostStatHelperSolaris::refreshProcess(ProcessStats* processStats) {
}
} catch (NullPointerException npe) {
if (m_logStatErrorCountDown-- > 0) {
- LOGERROR(npe.getMessage());
+ LOGERROR(npe.what());
}
}
// thread count
diff --git a/cppcache/src/statistics/HostStatSampler.cpp b/cppcache/src/statistics/HostStatSampler.cpp
index 0ecd1d0..030657c 100644
--- a/cppcache/src/statistics/HostStatSampler.cpp
+++ b/cppcache/src/statistics/HostStatSampler.cpp
@@ -752,7 +752,7 @@ int32_t HostStatSampler::svc(void) {
} catch (Exception& e) {
// log the exception and let the thread exit.
LOGERROR("Exception in statistics sampler thread: %s: %s", e.getName(),
- e.getMessage());
+ e.what());
// now close current archiver and see if we can start new one
gotexception = true;
} catch (...) {
@@ -768,7 +768,7 @@ int32_t HostStatSampler::svc(void) {
} catch (Exception& e) {
// log the exception and let the thread exit.
LOGERROR("Exception in statistics sampler thread: %s: %s", e.getName(),
- e.getMessage());
+ e.what());
closeSpecialStats();
} /* catch (...) {
// log the exception and let the thread exit.
diff --git a/cppcache/src/statistics/PoolStatsSampler.cpp b/cppcache/src/statistics/PoolStatsSampler.cpp
index f53ca28..f40c942 100644
--- a/cppcache/src/statistics/PoolStatsSampler.cpp
+++ b/cppcache/src/statistics/PoolStatsSampler.cpp
@@ -125,10 +125,13 @@ void PoolStatsSampler::putStatsInAdminRegion() {
} catch (const AllConnectionsInUseException&) {
LOGDEBUG("All connection are in use, trying again.");
} catch (const NotConnectedException& ex) {
- if (std::dynamic_pointer_cast<NoAvailableLocatorsException>(
- ex.getCause())) {
+ try
+ {
+ std::rethrow_if_nested(ex);
+ } catch (const NoAvailableLocatorsException& ex) {
LOGDEBUG("No locators available, trying again.");
- } else {
+ }
+ catch (...) {
LOGDEBUG("Not connected to geode, trying again.");
}
} catch (...) {
diff --git a/cppcache/src/StackFrame.cpp b/cppcache/test/ExceptionTypesTest.cpp
similarity index 53%
rename from cppcache/src/StackFrame.cpp
rename to cppcache/test/ExceptionTypesTest.cpp
index 3c67a85..12890fa 100644
--- a/cppcache/src/StackFrame.cpp
+++ b/cppcache/test/ExceptionTypesTest.cpp
@@ -14,30 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <ace/OS.h>
-#include <geode/geode_globals.hpp>
-#include "StackFrame.hpp"
-#include <geode/geode_base.hpp>
-namespace apache {
-namespace geode {
-namespace client {
-char* StackFrame::asString() {
- if (m_string[0] == 0) {
- char* tmp_module = m_module;
- int32_t modlen = static_cast<int32_t>(strlen(tmp_module));
- while (modlen > 0) {
- if ((tmp_module[modlen] == '\\') || (tmp_module[modlen] == '/')) {
- modlen++;
- break;
- }
- modlen--;
- }
- ACE_OS::snprintf(m_string, 1024, "%s at %s in %s", m_symbol, m_offset,
- tmp_module + modlen);
- }
- return m_string;
+#include <gtest/gtest.h>
+
+#include <geode/ExceptionTypes.hpp>
+
+using namespace apache::geode::client;
+
+TEST(ExceptionTypesTest, testExceptionGetName) {
+ AssertionException e("an exception message");
+ EXPECT_EQ("apache::geode::client::AssertionException",
+ std::string(e.getName()));
}
-} // namespace client
-} // namespace geode
-} // namespace apache
diff --git a/dependencies/boost/CMakeLists.txt b/dependencies/boost/CMakeLists.txt
index 02daa28..76a960e 100644
--- a/dependencies/boost/CMakeLists.txt
+++ b/dependencies/boost/CMakeLists.txt
@@ -67,6 +67,7 @@ set( ${PROJECT_NAME}_INSTALL_DIR ${INSTALL_DIR} )
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${${PROJECT_NAME}_INSTALL_DIR}/include>
+ $<BUILD_INTERFACE:${${PROJECT_NAME}_INSTALL_DIR}/src>
)
target_compile_definitions(${PROJECT_NAME} INTERFACE
)
diff --git a/tests/cli/CMakeLists.txt b/tests/cli/CMakeLists.txt
index 2891685..b040035 100644
--- a/tests/cli/CMakeLists.txt
+++ b/tests/cli/CMakeLists.txt
@@ -51,4 +51,4 @@ foreach(FILE ${CSPROJECTS})
PLATFORM ${PLATFORM})
set_target_properties(${PROJNAME} PROPERTIES FOLDER test/cliTests)
-endforeach()
\ No newline at end of file
+endforeach()
diff --git a/tests/cpp/fwk/UdpIpc.cpp b/tests/cpp/fwk/UdpIpc.cpp
index 13ccf0a..3553dea 100644
--- a/tests/cpp/fwk/UdpIpc.cpp
+++ b/tests/cpp/fwk/UdpIpc.cpp
@@ -55,7 +55,7 @@ TESTTASK initialize(const char *initArgs) {
try {
g_test = new UdpIpc(initArgs);
} catch (const FwkException &ex) {
- FWKSEVERE("initialize: caught exception: " << ex.getMessage());
+ FWKSEVERE("initialize: caught exception: " << ex.what());
result = FWK_SEVERE;
}
}
@@ -195,7 +195,7 @@ void UdpIpc::doService() {
FWKINFO("Time to stop.");
farm.stopThreads();
} catch (FwkException &ex) {
- FWKSEVERE("Caught exception " << ex.getMessage());
+ FWKSEVERE("Caught exception " << ex.what());
}
FWKINFO("Server stopped.");
@@ -248,7 +248,7 @@ void UdpIpc::doClient() {
if (msg.length() == 0) {
FWKINFO("NULL response.");
} else {
- std::string reply = msg.getMessage();
+ std::string reply = msg.what();
if (reply == "A result for you.") {
// nevermind
} else {
@@ -259,7 +259,7 @@ void UdpIpc::doClient() {
now = ACE_OS::gettimeofday();
}
} catch (FwkException &ex) {
- FWKSEVERE("Caught exception " << ex.getMessage());
+ FWKSEVERE("Caught exception " << ex.what());
}
FWKINFO("Stop");
FWKINFO("Client sent " << msgCnt << " messages");
diff --git a/tests/cpp/fwklib/FrameworkTest.cpp b/tests/cpp/fwklib/FrameworkTest.cpp
index 287c076..dd0024e 100644
--- a/tests/cpp/fwklib/FrameworkTest.cpp
+++ b/tests/cpp/fwklib/FrameworkTest.cpp
@@ -257,7 +257,7 @@ void FrameworkTest::cacheInitialize(
}
} catch (Exception& e) {
FWKEXCEPTION(
- "DistributedSystem::connect encountered Exception: " << e.getMessage());
+ "DistributedSystem::connect encountered Exception: " << e.what());
}
try {
@@ -270,7 +270,7 @@ void FrameworkTest::cacheInitialize(
m_cache = nullptr;
} catch (Exception& e) {
FWKEXCEPTION(
- "CacheFactory::create encountered Exception: " << e.getMessage());
+ "CacheFactory::create encountered Exception: " << e.what());
}
if (m_cache == nullptr) {
@@ -288,7 +288,7 @@ void FrameworkTest::cacheFinalize() {
} catch (CacheClosedException& ignore) {
} catch (Exception& e) {
FWKSEVERE("Caught an unexpected Exception during cache close: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKSEVERE("Caught an unexpected unknown exception during cache close.");
}
@@ -328,11 +328,11 @@ void FrameworkTest::localDestroyRegion(std::shared_ptr<Region>& region) {
try {
region->localDestroyRegion();
} catch (RegionDestroyedException& ignore) {
- ignore.getMessage();
+ ignore.what();
// the region could be already destroyed.
} catch (Exception& ex) {
FWKEXCEPTION("Caught unexpected exception during region local destroy: "
- << ex.getMessage());
+ << ex.what());
}
}
diff --git a/tests/cpp/fwklib/FwkBBClient.cpp b/tests/cpp/fwklib/FwkBBClient.cpp
index a6ed963..cd081f0 100644
--- a/tests/cpp/fwklib/FwkBBClient.cpp
+++ b/tests/cpp/fwklib/FwkBBClient.cpp
@@ -66,14 +66,14 @@ void FwkBBClient::sendToServer(FwkBBMessage& message) {
nrCnt++;
FWKEXCEPTION("No Reply from server in FwkBBClient::sendToServer");
}
- message.fromMessageStream(udpMsg.getMessage());
+ message.fromMessageStream(udpMsg.what());
m_result.clear();
m_result = message.getResult();
done = true;
} catch (FwkException& /* ex */) {
eCnt++;
// FWKSEVERE( "Caught exception in FwkBBClient::sendToServer: " <<
- // ex.getMessage() << ", tried to send: " << msg.substr( 0, 50 ) );
+ // ex.what() << ", tried to send: " << msg.substr( 0, 50 ) );
}
}
if (!done) {
@@ -90,7 +90,7 @@ std::string FwkBBClient::dump() {
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return m_result;
}
@@ -103,7 +103,7 @@ std::string FwkBBClient::dump(const std::string& BBName) {
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return m_result;
}
@@ -116,7 +116,7 @@ void FwkBBClient::clear(const std::string& BBName) {
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
}
@@ -131,7 +131,7 @@ std::string FwkBBClient::getString(const std::string& BBName,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return m_result;
}
@@ -146,7 +146,7 @@ int64_t FwkBBClient::get(const std::string& BBName, const std::string& Key) {
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -163,7 +163,7 @@ void FwkBBClient::set(const std::string& BBName, const std::string& Key,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
}
@@ -179,7 +179,7 @@ void FwkBBClient::set(const std::string& BBName, const std::string& Key,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
}
@@ -194,7 +194,7 @@ int64_t FwkBBClient::add(const std::string& BBName, const std::string& Key,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -210,7 +210,7 @@ int64_t FwkBBClient::subtract(const std::string& BBName, const std::string& Key,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -225,7 +225,7 @@ int64_t FwkBBClient::increment(const std::string& BBName,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -240,7 +240,7 @@ int64_t FwkBBClient::decrement(const std::string& BBName,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -254,7 +254,7 @@ void FwkBBClient::zero(const std::string& BBName, const std::string& Key) {
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
}
@@ -269,7 +269,7 @@ int64_t FwkBBClient::setIfGreater(const std::string& BBName,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
@@ -285,7 +285,7 @@ int64_t FwkBBClient::setIfLess(const std::string& BBName,
try {
sendToServer(message);
} catch (FwkException& ex) {
- ex.getMessage();
+ ex.what();
}
return FwkStrCvt::toInt64(m_result.c_str());
}
diff --git a/tests/cpp/fwklib/FwkBBServer.hpp b/tests/cpp/fwklib/FwkBBServer.hpp
index f6e6d8f..60643ed 100644
--- a/tests/cpp/fwklib/FwkBBServer.hpp
+++ b/tests/cpp/fwklib/FwkBBServer.hpp
@@ -160,7 +160,7 @@ class BBProcessor : public ServiceTask {
if (msg != NULL) {
// Construct the FwkBBMessage
FwkBBMessage message;
- message.fromMessageStream(msg->getMessage());
+ message.fromMessageStream(msg->what());
// Construct the reply
FwkBBMessage reply(BB_SET_ACK_COMMAND);
reply.setId(message.getId());
@@ -208,7 +208,7 @@ class BBProcessor : public ServiceTask {
}
} catch (FwkException& ex) {
FWKSEVERE(
- "BBProcessor::doTask() caught exception: " << ex.getMessage());
+ "BBProcessor::doTask() caught exception: " << ex.what());
} catch (...) {
FWKSEVERE("BBProcessor::doTask() caught unknown exception");
}
diff --git a/tests/cpp/fwklib/FwkLog.cpp b/tests/cpp/fwklib/FwkLog.cpp
index 42763d2..950c08e 100644
--- a/tests/cpp/fwklib/FwkLog.cpp
+++ b/tests/cpp/fwklib/FwkLog.cpp
@@ -82,6 +82,7 @@ void apache::geode::client::testframework::plog(const char* l, const char* s,
}
void apache::geode::client::testframework::dumpStack() {
- apache::geode::client::Exception trace("StackTrace", " ", true);
- trace.printStackTrace();
+ apache::geode::client::Exception trace("StackTrace ");
+ fprintf(stdout, "%s\n", trace.getStackTrace().c_str());
+ fflush(stdout);
}
diff --git a/tests/cpp/fwklib/QueryHelper.hpp b/tests/cpp/fwklib/QueryHelper.hpp
index 145e610..974cf46 100644
--- a/tests/cpp/fwklib/QueryHelper.hpp
+++ b/tests/cpp/fwklib/QueryHelper.hpp
@@ -920,7 +920,7 @@ void QueryHelper::destroyPortfolioOrPositionData(std::shared_ptr<Region>& rptr,
}
} catch (Exception& e) {
FWKSEVERE("QueryHelper::destroyPortfolioOrPositionData Caught Exception: "
- << e.getMessage());
+ << e.what());
}
FWKINFO("destroy done \n");
}
@@ -945,7 +945,7 @@ void QueryHelper::invalidatePortfolioOrPositionData(
} catch (Exception& e) {
FWKSEVERE(
"QueryHelper::invalidatePortfolioOrPositionData Caught Exception: "
- << e.getMessage());
+ << e.what());
}
FWKINFO("Invalidation done \n");
}
diff --git a/tests/cpp/fwklib/Service.cpp b/tests/cpp/fwklib/Service.cpp
index d338137..92b5dfe 100644
--- a/tests/cpp/fwklib/Service.cpp
+++ b/tests/cpp/fwklib/Service.cpp
@@ -44,7 +44,7 @@ int32_t Service::svc() {
task->doTask();
task->finalize();
} catch (FwkException& ex) {
- FWKERROR("Service: Caught exception in svc: " << ex.getMessage());
+ FWKERROR("Service: Caught exception in svc: " << ex.what());
} catch (...) {
FWKERROR("Service: Caught exception in svc.");
}
diff --git a/tests/cpp/fwklib/Service.hpp b/tests/cpp/fwklib/Service.hpp
index 859533a..f783178 100644
--- a/tests/cpp/fwklib/Service.hpp
+++ b/tests/cpp/fwklib/Service.hpp
@@ -146,7 +146,7 @@ class IPCMessage {
virtual ~IPCMessage() {}
- std::string& getMessage() { return m_msg; }
+ std::string& what() { return m_msg; }
uint32_t length() { return static_cast<uint32_t>(m_msg.size()); }
diff --git a/tests/cpp/fwklib/TestClient.cpp b/tests/cpp/fwklib/TestClient.cpp
index ab7bb73..6dd63c9 100644
--- a/tests/cpp/fwklib/TestClient.cpp
+++ b/tests/cpp/fwklib/TestClient.cpp
@@ -89,11 +89,11 @@ int32_t TestClient::runTask(ClientTask* task, ACE_thread_t id) {
} catch (FwkException& ex) {
cleanup = true;
FWKSEVERE(
- "FwkException caught in TestClient::runTask: " << ex.getMessage());
+ "FwkException caught in TestClient::runTask: " << ex.what());
fwkResult = FWK_SEVERE;
} catch (Exception& ex) {
cleanup = true;
- FWKSEVERE("Exception caught in TestClient::runTask: " << ex.getMessage());
+ FWKSEVERE("Exception caught in TestClient::runTask: " << ex.what());
fwkResult = FWK_SEVERE;
} catch (std::exception& ex) {
cleanup = true;
diff --git a/tests/cpp/fwklib/UDPIpc.cpp b/tests/cpp/fwklib/UDPIpc.cpp
index 7741c1b..a9377f2 100644
--- a/tests/cpp/fwklib/UDPIpc.cpp
+++ b/tests/cpp/fwklib/UDPIpc.cpp
@@ -180,7 +180,7 @@ UDPMessageClient::UDPMessageClient(std::string server)
msg.setCmd(ADDR_REQUEST);
if (msg.sendTo(m_io, m_server)) {
if (msg.receiveFrom(m_io, &timeout)) {
- std::string newConn = msg.getMessage();
+ std::string newConn = msg.what();
ACE_INET_Addr conn(newConn.c_str());
if (msg.ping(m_io, conn)) { // We have a working addr
m_server = conn;
@@ -243,7 +243,7 @@ int32_t Receiver::doTask() {
}
}
} catch (FwkException& ex) {
- FWKSEVERE("Receiver::doTask() caught exception: " << ex.getMessage());
+ FWKSEVERE("Receiver::doTask() caught exception: " << ex.what());
} catch (...) {
FWKSEVERE("Receiver::doTask() caught unknown exception");
}
@@ -305,7 +305,7 @@ int32_t STReceiver::doTask() {
}
}
} catch (FwkException& ex) {
- FWKSEVERE("STReceiver::doTask() caught exception: " << ex.getMessage());
+ FWKSEVERE("STReceiver::doTask() caught exception: " << ex.what());
} catch (...) {
FWKSEVERE("STReceiver::doTask() caught unknown exception");
}
@@ -345,7 +345,7 @@ int32_t Responder::doTask() {
}
}
} catch (FwkException& ex) {
- FWKSEVERE("Responder::doTask() caught exception: " << ex.getMessage());
+ FWKSEVERE("Responder::doTask() caught exception: " << ex.what());
} catch (...) {
FWKSEVERE("Responder::doTask() caught unknown exception");
}
diff --git a/tests/cpp/fwklib/UDPIpc.hpp b/tests/cpp/fwklib/UDPIpc.hpp
index dc143d9..a7b1217 100644
--- a/tests/cpp/fwklib/UDPIpc.hpp
+++ b/tests/cpp/fwklib/UDPIpc.hpp
@@ -85,7 +85,7 @@ class UDPMessage : public IPCMessage {
UDPMessage(std::string content) : IPCMessage(content) { clearHdr(); }
- UDPMessage(UDPMessage& msg) : IPCMessage(msg.getMessage()) {
+ UDPMessage(UDPMessage& msg) : IPCMessage(msg.what()) {
clearHdr();
setCmd(msg.getCmd());
}
diff --git a/tests/cpp/fwklib/testframeworkdox.txt b/tests/cpp/fwklib/testframeworkdox.txt
index f627f75..9fb2e30 100755
--- a/tests/cpp/fwklib/testframeworkdox.txt
+++ b/tests/cpp/fwklib/testframeworkdox.txt
@@ -22,4 +22,4 @@ COLLABORATION_GRAPH = YES
CALL_GRAPH = YES
INCLUDE_PATH = /GsSolution/testframework
OUTPUT_DIRECTORY = /GsSolution/testframework/Doc
-STRIP_FROM_PATH = /GsSolution/
\ No newline at end of file
+STRIP_FROM_PATH = /GsSolution/
diff --git a/tests/cpp/security/Security.cpp b/tests/cpp/security/Security.cpp
index 7863173..2d0cf95 100644
--- a/tests/cpp/security/Security.cpp
+++ b/tests/cpp/security/Security.cpp
@@ -65,7 +65,7 @@ TESTTASK initialize(const char *initArgs) {
try {
g_test = new Security(initArgs);
} catch (const FwkException &ex) {
- FWKSEVERE("initialize: caught exception: " << ex.getMessage());
+ FWKSEVERE("initialize: caught exception: " << ex.what());
result = FWK_SEVERE;
}
}
@@ -184,7 +184,7 @@ TESTTASK doCreateRegion(const char *taskId) {
result = g_test->createRegion();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doCreateRegion caught exception: " << ex.getMessage());
+ FWKSEVERE("doCreateRegion caught exception: " << ex.what());
}
return result;
@@ -198,7 +198,7 @@ TESTTASK doCheckValues(const char *taskId) {
result = g_test->checkValues();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doCheckValues caught exception: " << ex.getMessage());
+ FWKSEVERE("doCheckValues caught exception: " << ex.what());
}
return result;
@@ -215,7 +215,7 @@ TESTTASK doEntryOperations(const char *taskId) {
result = g_test->doEntryOperations();
} catch (const FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doEntryOperations caught exception: " << ex.getMessage());
+ FWKSEVERE("doEntryOperations caught exception: " << ex.what());
}
return result;
}
@@ -228,7 +228,7 @@ TESTTASK doPopulateRegion( const char * taskId ) {
result = g_test->populateRegion();
} catch ( FwkException ex ) {
result = FWK_SEVERE;
- FWKSEVERE( "doPopulateRegion caught exception: " << ex.getMessage() );
+ FWKSEVERE( "doPopulateRegion caught exception: " << ex.what() );
}
return result;
@@ -243,7 +243,7 @@ TESTTASK doRegisterInterestList(const char *taskId) {
result = g_test->registerInterestList();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doRegisterInterestList caught exception: " << ex.getMessage());
+ FWKSEVERE("doRegisterInterestList caught exception: " << ex.what());
}
return result;
@@ -257,7 +257,7 @@ TESTTASK doRegisterRegexList(const char *taskId) {
result = g_test->registerRegexList();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doRegisterRegexList caught exception: " << ex.getMessage());
+ FWKSEVERE("doRegisterRegexList caught exception: " << ex.what());
}
return result;
@@ -270,7 +270,7 @@ TESTTASK doUnRegisterRegexList(const char *taskId) {
result = g_test->unregisterRegexList();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doRegisterRegexList caught exception: " << ex.getMessage());
+ FWKSEVERE("doRegisterRegexList caught exception: " << ex.what());
}
return result;
@@ -283,7 +283,7 @@ TESTTASK doRegisterAllKeys(const char *taskId) {
result = g_test->registerAllKeys();
} catch (FwkException &ex) {
result = FWK_SEVERE;
- FWKSEVERE("doRegisterAllKeys caught exception: " << ex.getMessage());
+ FWKSEVERE("doRegisterAllKeys caught exception: " << ex.what());
}
return result;
@@ -298,7 +298,7 @@ TESTTASK doVerifyInterestList( const char * taskId ) {
result = g_test->verifyInterestList();
} catch ( FwkException ex ) {
result = FWK_SEVERE;
- FWKSEVERE( "doVerifyInterestList caught exception: " << ex.getMessage() );
+ FWKSEVERE( "doVerifyInterestList caught exception: " << ex.what() );
}
return result;
@@ -313,7 +313,7 @@ TESTTASK doServerKeys( const char * taskId ) {
result = g_test->doServerKeys();
} catch ( FwkException ex ) {
result = FWK_SEVERE;
- FWKSEVERE( "doServerKeys caught exception: " << ex.getMessage() );
+ FWKSEVERE( "doServerKeys caught exception: " << ex.what() );
}
return result;
@@ -337,7 +337,7 @@ on." );
try {
regionPtr->serverKeys( keysVec );
} catch( Exception & e ) {
- FWKEXCEPTION( "Exception thrown by serverKeys(): " << e.getMessage() );
+ FWKEXCEPTION( "Exception thrown by serverKeys(): " << e.what() );
}
int32_t keys = keysVec.size();
@@ -472,10 +472,10 @@ int32_t Security::createRegion() {
} catch (Exception &e) {
FWKSEVERE("Security::createRegion FAILED -- caught exception: "
- << e.getMessage());
+ << e.what());
} catch (FwkException &e) {
FWKSEVERE("Security::createRegion FAILED -- caught test exception: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKSEVERE("Security::createRegion FAILED -- caught unknown exception.");
}
@@ -527,10 +527,10 @@ numOfRegisterKeys);
} catch ( Exception e ) {
FWKSEVERE( "Security::verifyInterestList Caught Exception: " <<
-e.getMessage() );
+e.what() );
} catch ( FwkException& e ) {
FWKSEVERE( "Security::verifyInterestList Caught FwkException: " <<
-e.getMessage() );
+e.what() );
} catch ( ... ) {
FWKSEVERE( "Security::verifyInterestList Caught unknown exception." );
}
@@ -561,11 +561,11 @@ int32_t Security::populateRegion()
FWKSEVERE( "Security::populateRegion() Caught std::exception: " << e.what()
);
} catch ( Exception e ) {
- FWKSEVERE( "Security::populateRegion() Caught Exception: " << e.getMessage()
+ FWKSEVERE( "Security::populateRegion() Caught Exception: " << e.what()
);
} catch ( FwkException& e ) {
FWKSEVERE( "Security::populateRegion() Caught FwkException: " <<
-e.getMessage() );
+e.what() );
} catch ( ... ) {
FWKSEVERE( "Security::populateRegion() Caught unknown exception." );
}
@@ -612,10 +612,10 @@ int32_t Security::registerInterestList() {
} catch (Exception &e) {
FWKEXCEPTION("Security::registerInterestList() Caught Exception: "
- << e.getMessage());
+ << e.what());
} catch (FwkException &e) {
FWKEXCEPTION("Security::registerInterestList() Caught FwkException: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKEXCEPTION("Security::registerInterestList() Caught unknown exception.");
}
@@ -638,10 +638,10 @@ int32_t Security::registerRegexList() {
} catch (Exception &e) {
FWKSEVERE(
- "Security::registerRegexList() Caught Exception: " << e.getMessage());
+ "Security::registerRegexList() Caught Exception: " << e.what());
} catch (FwkException &e) {
FWKSEVERE("Security::registerRegexList() Caught FwkException: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKSEVERE("Security::registerRegexList() Caught unknown exception.");
}
@@ -663,10 +663,10 @@ int32_t Security::unregisterRegexList() {
} catch (Exception &e) {
FWKSEVERE(
- "Security::unregisterRegexList() Caught Exception: " << e.getMessage());
+ "Security::unregisterRegexList() Caught Exception: " << e.what());
} catch (FwkException &e) {
FWKSEVERE("Security::unregisterRegexList() Caught FwkException: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKSEVERE("Security::unregisterRegexList() Caught unknown exception.");
}
@@ -687,10 +687,10 @@ int32_t Security::registerAllKeys() {
} catch (Exception &e) {
FWKSEVERE(
- "Security::registerAllKeys() Caught Exception: " << e.getMessage());
+ "Security::registerAllKeys() Caught Exception: " << e.what());
} catch (FwkException &e) {
FWKSEVERE(
- "Security::registerAllKeys() Caught FwkException: " << e.getMessage());
+ "Security::registerAllKeys() Caught FwkException: " << e.what());
} catch (...) {
FWKSEVERE("Security::registerAllKeys() Caught unknown exception.");
}
@@ -728,10 +728,10 @@ int32_t Security::checkValues() {
result = FWK_SUCCESS;
} catch (Exception &e) {
FWKSEVERE(
- "Security::checkValues FAILED -- caught exception: " << e.getMessage());
+ "Security::checkValues FAILED -- caught exception: " << e.what());
} catch (FwkException &e) {
FWKSEVERE("Security::checkValues FAILED -- caught test exception: "
- << e.getMessage());
+ << e.what());
} catch (...) {
FWKSEVERE("Security::checkValues FAILED -- caught unknown exception.");
}
@@ -783,17 +783,17 @@ std::shared_ptr<Region> Security::getRegionPtr(const char *reg) {
FWKEXCEPTION(
"In Security::getRegionPtr() CacheFactory::getInstance encountered "
"CacheClosedException: "
- << e.getMessage());
+ << e.what());
} catch (EntryNotFoundException &e) {
FWKEXCEPTION(
"In Security::getRegionPtr() CacheFactory::getInstance encountered "
"EntryNotFoundException: "
- << e.getMessage());
+ << e.what());
} catch (IllegalArgumentException &e) {
FWKEXCEPTION(
"In Security::getRegionPtr() CacheFactory::getInstance encountered "
"IllegalArgumentException: "
- << e.getMessage());
+ << e.what());
}
return region;
}
@@ -932,10 +932,10 @@ void Security::runQuery(int32_t &queryCnt) {
}
} catch (Exception &e) {
FWKEXCEPTION(
- "CacheServerTest::runQuery Caught Exception: " << e.getMessage());
+ "CacheServerTest::runQuery Caught Exception: " << e.what());
} catch (FwkException &e) {
FWKEXCEPTION(
- "CacheServerTest::runQuery Caught FwkException: " << e.getMessage());
+ "CacheServerTest::runQuery Caught FwkException: " << e.what());
} catch (...) {
FWKEXCEPTION("CacheServerTest::runQuery Caught unknown exception.");
}
@@ -1050,19 +1050,19 @@ int32_t Security::doEntryOperations() {
} catch (TimeoutException &e) {
fwkResult = FWK_SEVERE;
FWKSEVERE("Caught unexpected timeout exception during entry "
- << opcode << " operation: " << e.getMessage()
+ << opcode << " operation: " << e.what()
<< " continuing with test.");
} catch (EntryExistsException &ignore) {
- ignore.getMessage();
+ ignore.what();
} catch (EntryNotFoundException &ignore) {
- ignore.getMessage();
+ ignore.what();
} catch (EntryDestroyedException &ignore) {
- ignore.getMessage();
+ ignore.what();
} catch (Exception &e) {
end = 0;
fwkResult = FWK_SEVERE;
FWKSEVERE("Caught unexpected exception during entry "
- << opcode << " operation: " << e.getMessage()
+ << opcode << " operation: " << e.what()
<< " exiting task.");
}
meter.checkPace();
diff --git a/tests/cpp/testobject/ArrayOfByte.hpp b/tests/cpp/testobject/ArrayOfByte.hpp
index 43e98d1..8adae05 100644
--- a/tests/cpp/testobject/ArrayOfByte.hpp
+++ b/tests/cpp/testobject/ArrayOfByte.hpp
@@ -62,7 +62,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
dos.writeInt(timestamp);
}
} catch (Exception &e) {
- FWKEXCEPTION("Unable to write to stream " << e.getMessage());
+ FWKEXCEPTION("Unable to write to stream " << e.what());
}
int32_t bufSize = size;
char *buf = new char[bufSize];
@@ -94,7 +94,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
}
return timestamp;
} catch (Exception &e) {
- FWKEXCEPTION("Unable to read from stream " << e.getMessage());
+ FWKEXCEPTION("Unable to read from stream " << e.what());
}
}
@@ -109,7 +109,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
return;
}
} catch (Exception &e) {
- FWKEXCEPTION("Unable to read from stream " << e.getMessage());
+ FWKEXCEPTION("Unable to read from stream " << e.what());
}
DataOutputInternal dos;
try {
@@ -121,7 +121,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
int64_t timestamp = tusec * 1000;
dos.writeInt(timestamp);
} catch (Exception &e) {
- FWKEXCEPTION("Unable to write to stream " << e.getMessage());
+ FWKEXCEPTION("Unable to write to stream " << e.what());
}
}
};
diff --git a/tests/cpp/testobject/InvalidPdxUsage.cpp b/tests/cpp/testobject/InvalidPdxUsage.cpp
index 114233c..e194b32 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.cpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.cpp
@@ -90,7 +90,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeArrayOfByteArrays():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -99,7 +99,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeWideChar():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -108,7 +108,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeBoolean():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -117,7 +117,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeBooleanArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -125,7 +125,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_byte");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -134,7 +134,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -143,7 +143,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeWideCharArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -152,7 +152,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObject() for ArrayList:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -161,7 +161,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObject() for Map:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -170,7 +170,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObject() for HashTable:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -179,7 +179,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObject() for Vector:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -189,7 +189,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
toDataexceptionCounter++;
LOGINFO(
"writeObject() for CacheableHashSet:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -200,7 +200,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
LOGINFO(
"writeObject() for CacheableLinkedHashSet:: Got expected Exception :: "
"%s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -209,7 +209,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeString():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -217,7 +217,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_dateTime");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeDate():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeDate():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -226,7 +226,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeDouble():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -235,7 +235,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeDoubleArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -243,7 +243,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_float");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeFloat():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeFloat():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -252,7 +252,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeFloatArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -260,7 +260,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_int16");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -268,7 +268,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_int32");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -276,7 +276,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_long");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -285,7 +285,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeIntArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -294,7 +294,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeLongArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -303,7 +303,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeShortArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -311,7 +311,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_sbyte");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeByte():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -320,7 +320,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -329,7 +329,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeStringArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -337,7 +337,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_uint16");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeShort():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -345,7 +345,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_uint32");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -353,7 +353,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->markIdentityField("m_ulong");
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
- LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeLong():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -362,7 +362,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeIntArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -371,7 +371,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeLongArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -380,7 +380,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeShortArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -389,7 +389,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -398,7 +398,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -407,7 +407,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -416,7 +416,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -425,7 +425,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObject() for Enum:: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -435,7 +435,7 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
LOGINFO(
"writeObject() for Custom Object Address:: Got expected Exception :: "
"%s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -443,14 +443,14 @@ void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
} catch (IllegalStateException& excpt) {
toDataexceptionCounter++;
LOGINFO("writeObjectArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
pw->writeInt("toDataexceptionCounter", toDataexceptionCounter);
pw->writeInt("fromDataexceptionCounter", fromDataexceptionCounter);
} catch (IllegalStateException& excpt) {
- LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("writeInt():: Got expected Exception :: %s ", excpt.what());
}
LOGDEBUG("PdxObject::toData() Done......");
@@ -472,7 +472,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readArrayOfByteArrays():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -480,7 +480,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readWideChar():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -488,7 +488,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readBoolean():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -496,14 +496,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readBooleanArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_byte = pr->readByte("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readByte():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readByte():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -511,7 +511,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -519,7 +519,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readWideCharArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -527,14 +527,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
std::dynamic_pointer_cast<CacheableArrayList>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
m_map = std::dynamic_pointer_cast<CacheableHashMap>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -542,21 +542,21 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
std::dynamic_pointer_cast<CacheableHashTable>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
m_vector = std::dynamic_pointer_cast<CacheableVector>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
m_chs = std::dynamic_pointer_cast<CacheableHashSet>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -564,28 +564,28 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
std::dynamic_pointer_cast<CacheableLinkedHashSet>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
m_string = pr->readString(""); // GenericValCompare
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readString():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readString():: Got expected Exception :: %s ", excpt.what());
}
try {
m_date = std::dynamic_pointer_cast<CacheableDate>(pr->readDate(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readDate():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readDate():: Got expected Exception :: %s ", excpt.what());
}
try {
m_double = pr->readDouble("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readDouble():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readDouble():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -593,14 +593,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readDoubleArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_float = pr->readFloat("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readFloat():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readFloat():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -608,28 +608,28 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readFloatArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_int16 = pr->readShort("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readShort():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readShort():: Got expected Exception :: %s ", excpt.what());
}
try {
m_int32 = pr->readInt("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readInt():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readInt():: Got expected Exception :: %s ", excpt.what());
}
try {
m_long = pr->readLong("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readLong():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readLong():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -637,7 +637,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readIntArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -645,7 +645,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readLongArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -653,21 +653,21 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readShortArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_sbyte = pr->readByte("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readByte():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readByte():: Got expected Exception :: %s ", excpt.what());
}
try {
m_sbyteArray = pr->readByteArray("", byteArrayLen);
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -675,28 +675,28 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readStringArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_uint16 = pr->readShort("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readShort():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readShort():: Got expected Exception :: %s ", excpt.what());
}
try {
m_uint32 = pr->readInt("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readInt():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readInt():: Got expected Exception :: %s ", excpt.what());
}
try {
m_ulong = pr->readLong("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readLong():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readLong():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -704,7 +704,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readIntArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -712,7 +712,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readLongArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -720,7 +720,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readShortArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -728,14 +728,14 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_byte253 = pr->readByteArray("", m_byte253Len);
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -743,7 +743,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -751,21 +751,21 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readByteArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
m_pdxEnum = std::static_pointer_cast<CacheableEnum>(pr->readObject(""));
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
m_address = pr->readObject("");
} catch (IllegalStateException& excpt) {
exceptionCounter++;
- LOGINFO("readObject():: Got expected Exception :: %s ", excpt.getMessage());
+ LOGINFO("readObject():: Got expected Exception :: %s ", excpt.what());
}
try {
@@ -773,7 +773,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readObjectArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
try {
@@ -782,7 +782,7 @@ void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
} catch (IllegalStateException& excpt) {
exceptionCounter++;
LOGINFO("readObjectArray():: Got expected Exception :: %s ",
- excpt.getMessage());
+ excpt.what());
}
this->fromDataexceptionCounter = exceptionCounter;
--
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].