You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mm...@apache.org on 2021/08/28 21:42:36 UTC

[geode-native] 01/05: Demacroize: - _GF_MG_EXCEPTION_TRY2 - _GF_MG_EXCEPTION_CATCH_ALL2

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

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit b34490cad70b09fc22366941fce54197d2abac58
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 07:33:50 2021 -0700

    Demacroize:
    - _GF_MG_EXCEPTION_TRY2
    - _GF_MG_EXCEPTION_CATCH_ALL2
---
 clicache/src/Cache.cpp                          | 100 ++++-
 clicache/src/CacheFactory.cpp                   |  50 ++-
 clicache/src/CacheTransactionManager.cpp        | 160 +++++--
 clicache/src/CacheableHashSet.hpp               |  10 +-
 clicache/src/CqQuery.cpp                        |  70 ++-
 clicache/src/DataInput.cpp                      |  30 +-
 clicache/src/DistributedSystem.cpp              |  50 ++-
 clicache/src/ExceptionTypes.cpp                 | 125 +++---
 clicache/src/ExceptionTypes.hpp                 |  14 -
 clicache/src/Execution.cpp                      |  40 +-
 clicache/src/FunctionService.cpp                |  50 ++-
 clicache/src/LocalRegion.cpp                    | 330 +++++++++++---
 clicache/src/Log.cpp                            |  30 +-
 clicache/src/Pool.cpp                           |  20 +-
 clicache/src/PoolFactory.cpp                    | 240 ++++++++--
 clicache/src/Properties.cpp                     | 110 ++++-
 clicache/src/Query.cpp                          |  40 +-
 clicache/src/Region.cpp                         | 560 +++++++++++++++++++-----
 clicache/src/RegionAttributesFactory.cpp        |  40 +-
 clicache/src/RegionFactory.cpp                  |  40 +-
 clicache/src/ResultCollector.cpp                |  30 +-
 clicache/src/StructSet.cpp                      |  10 +-
 clicache/src/TypeRegistry.cpp                   |  30 +-
 clicache/src/UserFunctionExecutionException.cpp |  20 +-
 clicache/src/impl/AuthenticatedView.cpp         |  30 +-
 clicache/src/impl/GeodeDataInputStream.hpp      |  10 +-
 clicache/src/impl/GeodeDataOutputStream.hpp     |  20 +-
 27 files changed, 1758 insertions(+), 501 deletions(-)

diff --git a/clicache/src/Cache.cpp b/clicache/src/Cache.cpp
index 8cfbe52..2e6da5b 100644
--- a/clicache/src/Cache.cpp
+++ b/clicache/src/Cache.cpp
@@ -131,12 +131,18 @@ namespace Apache
 
       void Cache::Close( bool keepalive )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->get()->close( keepalive );
           Apache::Geode::Client::DistributedSystem::UnregisterBuiltinManagedTypes(this);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         finally
         {
 					CacheRegionHelper::getCacheImpl(m_nativeptr->get())->getPdxTypeRegistry()->clear();
@@ -148,7 +154,7 @@ namespace Apache
 
       void Cache::ReadyForEvents( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -159,13 +165,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
       Client::IRegion<TKey,TValue>^ Cache::GetRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -176,7 +188,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -204,7 +222,7 @@ namespace Apache
 
       Client::QueryService^ Cache::GetQueryService( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -215,12 +233,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Client::QueryService^ Cache::GetQueryService(String^ poolName )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -231,12 +255,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ Cache::CreateRegionFactory(RegionShortcut preDefinedRegionAttributes)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           auto preDefineRegionAttr = apache::geode::client::RegionShortcut(preDefinedRegionAttributes);
 
@@ -251,12 +281,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       IRegionService^ Cache::CreateAuthenticatedView(Properties<String^, Object^>^ credentials)
       {        
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -267,12 +303,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2   
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
       }
 
 			bool Cache::GetPdxIgnoreUnreadFields()
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
 					try
 					{
@@ -283,12 +325,18 @@ namespace Apache
 					  GC::KeepAlive(m_nativeptr);
 					}
 
-				_GF_MG_EXCEPTION_CATCH_ALL2   
+				}
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
 			}
 
       bool Cache::GetPdxReadSerialized()
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
 					try
 					{
@@ -299,13 +347,19 @@ namespace Apache
 					  GC::KeepAlive(m_nativeptr);
 					}
 
-				_GF_MG_EXCEPTION_CATCH_ALL2   
+				}
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
 			}
 
       IRegionService^ Cache::CreateAuthenticatedView(Properties<String^, Object^>^ credentials, String^ poolName)
       {
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -316,7 +370,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2   
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
       }
 
 			 void Cache::InitializeDeclarativeCache( String^ cacheXml )
diff --git a/clicache/src/CacheFactory.cpp b/clicache/src/CacheFactory.cpp
index 781cd57..5bbd7ce 100644
--- a/clicache/src/CacheFactory.cpp
+++ b/clicache/src/CacheFactory.cpp
@@ -59,7 +59,7 @@ namespace Apache
         native::createAppDomainContext = &Apache::Geode::Client::createAppDomainContext;
 				bool pdxIgnoreUnreadFields = false;
         bool pdxReadSerialized = false;
-        _GF_MG_EXCEPTION_TRY2
+        try {
           //msclr::lock lockInstance(m_singletonSync);
           auto nativeCache = std::make_shared<native::Cache>(m_nativeptr->get()->create( ));
 
@@ -80,7 +80,13 @@ namespace Apache
           cacheImpl->getSerializationRegistry()->setDataSerializableHandler(new ManagedDataSerializableHandler());
 
           return cache;
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         finally {
           GC::KeepAlive(m_nativeptr);
         }
@@ -100,7 +106,7 @@ namespace Apache
 
 			CacheFactory^ CacheFactory::SetPdxIgnoreUnreadFields(bool ignore)
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
           try
           {
@@ -112,12 +118,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
 			}
 
       CacheFactory^ CacheFactory::SetPdxReadSerialized(bool pdxReadSerialized)
       {
-        	_GF_MG_EXCEPTION_TRY2
+        	try {
 
           try
           {
@@ -129,12 +141,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       CacheFactory^ CacheFactory::Set(String^ name, String^ value)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           try
           {
             m_nativeptr->get()->set(marshal_as<std::string>(name), to_utf8(value));
@@ -145,12 +163,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       CacheFactory^ CacheFactory::SetAuthInitialize(IAuthInitialize^ authInitialize)
       {
-        	_GF_MG_EXCEPTION_TRY2
+        	try {
 
           try
           {
@@ -167,7 +191,13 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
     }  // namespace Client
diff --git a/clicache/src/CacheTransactionManager.cpp b/clicache/src/CacheTransactionManager.cpp
index f5b39ed..60ef9ac 100644
--- a/clicache/src/CacheTransactionManager.cpp
+++ b/clicache/src/CacheTransactionManager.cpp
@@ -33,111 +33,183 @@ namespace Apache
 
       void CacheTransactionManager::Begin( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->begin( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Prepare( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->prepare( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Commit( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
             m_nativeptr->commit( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Rollback( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
             m_nativeptr->rollback( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       bool CacheTransactionManager::Exists( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         return m_nativeptr->exists( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Apache::Geode::Client::TransactionId^ CacheTransactionManager::Suspend( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
        
           return Apache::Geode::Client::TransactionId::Create(&m_nativeptr->suspend());
        
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 			Apache::Geode::Client::TransactionId^ CacheTransactionManager::TransactionId::get( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return Apache::Geode::Client::TransactionId::Create(&m_nativeptr->getTransactionId());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       void CacheTransactionManager::Resume(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->resume(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::IsSuspended(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->isSuspended(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::TryResume(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->tryResume(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::TryResume(Apache::Geode::Client::TransactionId^ transactionId, TimeSpan waitTime)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->tryResume(transactionId->GetNative(), TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(waitTime));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::Exists(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->exists(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
 #ifdef CSTX_COMMENTED
       generic<class TKey, class TValue>
       ITransactionWriter<TKey, TValue>^ CacheTransactionManager::GetWriter( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           // Conver the unmanaged object to  managed generic object 
           std::shared_ptr<apache::geode::client::TransactionWriter>& writerPtr( m_nativeptr->getWriter( ) );
@@ -149,7 +221,13 @@ namespace Apache
             return (ITransactionWriter<TKey, TValue>^)twg->userptr( );
           }
         
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         
         return nullptr;
       }
@@ -157,7 +235,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void CacheTransactionManager::SetWriter(ITransactionWriter<TKey, TValue>^ transactionWriter)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create a unmanaged object using the ManagedTransactionWriterGeneric.
           // Set the generic object inside the TransactionWriterGeneric that is a non generic object
           std::shared_ptr<apache::geode::client::TransactionWriter> writerPtr;
@@ -170,13 +248,19 @@ namespace Apache
           }
           m_nativeptr->setWriter( writerPtr );
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
       void CacheTransactionManager::AddListener(ITransactionListener<TKey, TValue>^ transactionListener)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create a unmanaged object using the ManagedTransactionListenerGeneric.
           // Set the generic object inside the TransactionListenerGeneric that is a non generic object
           std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
@@ -189,13 +273,19 @@ namespace Apache
           }
           m_nativeptr->addListener( listenerPtr );
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
         
       generic<class TKey, class TValue>
       void CacheTransactionManager::RemoveListener(ITransactionListener<TKey, TValue>^ transactionListener)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create an unmanaged non generic object using the managed generic object
           // use this to call the remove listener
           std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
@@ -208,7 +298,13 @@ namespace Apache
           }
           m_nativeptr->removeListener( listenerPtr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 #endif
     }  // namespace Client
diff --git a/clicache/src/CacheableHashSet.hpp b/clicache/src/CacheableHashSet.hpp
index eb6410c..31a9a8a 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -370,7 +370,7 @@ namespace Apache
           /// </param>
           virtual void Add(Object^ item)
           {
-            _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+            try {/* due to auto replace */
 
             try
             {
@@ -381,7 +381,13 @@ namespace Apache
               GC::KeepAlive(m_nativeptr);
             }
 
-            _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+            }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           }
 
           /// <summary>
diff --git a/clicache/src/CqQuery.cpp b/clicache/src/CqQuery.cpp
index 543ee67..241945d 100644
--- a/clicache/src/CqQuery.cpp
+++ b/clicache/src/CqQuery.cpp
@@ -49,7 +49,7 @@ namespace Apache
       generic<class TKey, class TResult>
       ICqResults<TResult>^ CqQuery<TKey, TResult>::ExecuteWithInitialResults(TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto nativeptr = m_nativeptr->get()->executeWithInitialResults(TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -65,13 +65,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Execute()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -82,7 +88,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
@@ -180,7 +192,7 @@ namespace Apache
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Stop( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -191,13 +203,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Close( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -208,13 +226,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       bool CqQuery<TKey, TResult>::IsRunning( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -225,13 +249,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       bool CqQuery<TKey, TResult>::IsStopped( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -242,13 +272,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
         bool CqQuery<TKey, TResult>::IsClosed()
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             try
           {
@@ -259,7 +295,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/DataInput.cpp b/clicache/src/DataInput.cpp
index e307293..e22193b 100644
--- a/clicache/src/DataInput.cpp
+++ b/clicache/src/DataInput.cpp
@@ -59,7 +59,7 @@ namespace Apache
         m_isRootObjectPdx = false;
         m_cache = cache;
         if (buffer != nullptr && size > 0) {
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           m_nativeptr = gcnew native_conditional_unique_ptr<native::DataInput>(
             std::make_unique<native::DataInput>(cache->GetNative()->createDataInput(buffer, size)));
@@ -77,7 +77,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
@@ -91,7 +97,7 @@ namespace Apache
         m_isRootObjectPdx = false;
         m_cache =  cache;
         if (buffer != nullptr && buffer->Length > 0) {
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           auto len = buffer->Length;
           m_ownedBuffer = make_native_unique<System::Byte[]>(len);
@@ -114,7 +120,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
@@ -133,7 +145,7 @@ namespace Apache
               "DataInput.ctor(): given length {0} is zero or greater than "
               "size of buffer {1}", len, buffer->Length));
           }
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           m_ownedBuffer = make_native_unique<System::Byte[]>(len);
           m_buffer = m_ownedBuffer->get();
@@ -152,7 +164,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
diff --git a/clicache/src/DistributedSystem.cpp b/clicache/src/DistributedSystem.cpp
index 57bfb2d..db3454d 100644
--- a/clicache/src/DistributedSystem.cpp
+++ b/clicache/src/DistributedSystem.cpp
@@ -133,7 +133,7 @@ namespace Apache
       DistributedSystem^ DistributedSystem::Connect(String^ name, Properties<String^, String^>^ config, Cache ^ cache)
       {
         // TODO AppDomain should we be able to create a DS directly?
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         auto nativeDistributedSystem = native::DistributedSystem::create(to_utf8(name),
                                                            config->GetNative());
@@ -144,16 +144,28 @@ namespace Apache
         return gcnew DistributedSystem(std::unique_ptr<native::DistributedSystem>(
             new native::DistributedSystem(std::move(nativeDistributedSystem))));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::Disconnect(Cache^ cache)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           DistributedSystem::UnregisterBuiltinManagedTypes(cache);
           m_nativeDistributedSystem->get()->disconnect();
           GC::KeepAlive(m_nativeDistributedSystem);
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::RegisterDataSerializablePrimitives(Cache^ cache)
@@ -313,7 +325,7 @@ namespace Apache
             gcnew TypeFactoryMethod(Apache::Geode::Client::Internal::PdxType::CreateDeserializable),
             nullptr);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           // Set the Generic ManagedCacheLoader/Listener/Writer factory functions.
           native::CacheXmlParser::managedCacheLoaderFn_ =
@@ -331,7 +343,13 @@ namespace Apache
           native::CacheXmlParser::managedPersistenceManagerFn_ =
             native::ManagedPersistenceManagerGeneric::create;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::ManagedPostConnect(Cache^ cache)
@@ -349,7 +367,7 @@ namespace Apache
 
       void DistributedSystem::UnregisterBuiltinManagedTypes(Cache^ cache)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           TypeRegistry::UnregisterNativesGeneric(cache);
 
@@ -376,17 +394,29 @@ namespace Apache
           cache->TypeRegistry->UnregisterTypeGeneric(
             static_cast<int8_t>(native::internal::InternalId::CacheableManagedObjectXml));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Apache::Geode::Client::SystemProperties^ DistributedSystem::SystemProperties::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return Apache::Geode::Client::SystemProperties::Create(
           &(m_nativeDistributedSystem->get()->getSystemProperties()));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       String^ DistributedSystem::Name::get()
diff --git a/clicache/src/ExceptionTypes.cpp b/clicache/src/ExceptionTypes.cpp
index db10029..82bcc7b 100644
--- a/clicache/src/ExceptionTypes.cpp
+++ b/clicache/src/ExceptionTypes.cpp
@@ -20,8 +20,7 @@
 #include "ExceptionTypes.hpp"
 #include <cstdlib>
 
-#define _GF_MG_EXCEPTION_ADD3(x) { "apache::geode::client::" #x, gcnew CreateException2( x::Create ) }
-#define _GF_MG_EXCEPTION_ADD4(x,y) { "apache::geode::client::" #y, gcnew CreateException2( x::Create ) }
+//#define _GF_MG_EXCEPTION_ADD4(x,y) { "apache::geode::client::" #y, gcnew CreateException2( x::Create ) }
 
 using namespace System;
 
@@ -40,67 +39,67 @@ namespace Apache
           return Native2ManagedExMap;
         }
         array<NameDelegatePair>^ exNamesDelegates = gcnew array<NameDelegatePair> {
-          _GF_MG_EXCEPTION_ADD3( AssertionException ),
-          _GF_MG_EXCEPTION_ADD3( IllegalArgumentException ),
-          _GF_MG_EXCEPTION_ADD3( IllegalStateException ),
-          _GF_MG_EXCEPTION_ADD3( CacheExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CacheXmlException ),
-          _GF_MG_EXCEPTION_ADD3( TimeoutException ),
-          _GF_MG_EXCEPTION_ADD3( CacheWriterException ),
-          _GF_MG_EXCEPTION_ADD3( CacheListenerException ),
-          _GF_MG_EXCEPTION_ADD3( RegionExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CacheClosedException ),
-          _GF_MG_EXCEPTION_ADD3( LeaseExpiredException ),
-          _GF_MG_EXCEPTION_ADD3( CacheLoaderException ),
-          _GF_MG_EXCEPTION_ADD3( RegionDestroyedException ),
-          _GF_MG_EXCEPTION_ADD3( EntryDestroyedException ),
-          _GF_MG_EXCEPTION_ADD3( NoSystemException ),
-          _GF_MG_EXCEPTION_ADD3( AlreadyConnectedException ),
-          _GF_MG_EXCEPTION_ADD3( FileNotFoundException ),          
-          _GF_MG_EXCEPTION_ADD3( InterruptedException ),
-          _GF_MG_EXCEPTION_ADD3( UnsupportedOperationException ),
-          _GF_MG_EXCEPTION_ADD3( StatisticsDisabledException ),
-          _GF_MG_EXCEPTION_ADD3( ConcurrentModificationException ),
-          _GF_MG_EXCEPTION_ADD3( UnknownException ),
-          _GF_MG_EXCEPTION_ADD3( ClassCastException ),
-          _GF_MG_EXCEPTION_ADD3( EntryNotFoundException ),
-          _GF_MG_EXCEPTION_ADD4( GeodeIOException, GeodeIOException ),
-          _GF_MG_EXCEPTION_ADD4( GeodeConfigException, GeodeConfigException ),
-          _GF_MG_EXCEPTION_ADD3( NullPointerException ),
-          _GF_MG_EXCEPTION_ADD3( EntryExistsException ),
-          _GF_MG_EXCEPTION_ADD3( NotConnectedException ),
-          _GF_MG_EXCEPTION_ADD3( CacheProxyException ),
-          _GF_MG_EXCEPTION_ADD3( OutOfMemoryException ),
-          _GF_MG_EXCEPTION_ADD3( NotOwnerException ),
-          _GF_MG_EXCEPTION_ADD3( WrongRegionScopeException ),
-          _GF_MG_EXCEPTION_ADD3( BufferSizeExceededException ),
-          _GF_MG_EXCEPTION_ADD3( RegionCreationFailedException ),
-          _GF_MG_EXCEPTION_ADD3( FatalInternalException ),
-          _GF_MG_EXCEPTION_ADD3( DiskFailureException ),
-          _GF_MG_EXCEPTION_ADD3( DiskCorruptException ),
-          _GF_MG_EXCEPTION_ADD3( InitFailedException ),
-          _GF_MG_EXCEPTION_ADD3( ShutdownFailedException ),
-          _GF_MG_EXCEPTION_ADD3( CacheServerException ),
-          _GF_MG_EXCEPTION_ADD3( OutOfRangeException ),
-          _GF_MG_EXCEPTION_ADD3( QueryException ),
-          _GF_MG_EXCEPTION_ADD3( MessageException ),
-          _GF_MG_EXCEPTION_ADD3( NotAuthorizedException ),
-          _GF_MG_EXCEPTION_ADD3( AuthenticationFailedException ),
-          _GF_MG_EXCEPTION_ADD3( AuthenticationRequiredException ),
-          _GF_MG_EXCEPTION_ADD3( DuplicateDurableClientException ),
-          _GF_MG_EXCEPTION_ADD3( NoAvailableLocatorsException ),
-          _GF_MG_EXCEPTION_ADD3( FunctionExecutionException ),
-          _GF_MG_EXCEPTION_ADD3( CqInvalidException ),
-          _GF_MG_EXCEPTION_ADD3( CqExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CqQueryException ),
-          _GF_MG_EXCEPTION_ADD3( CqClosedException ),
-          _GF_MG_EXCEPTION_ADD3( CqException ),
-          _GF_MG_EXCEPTION_ADD3( AllConnectionsInUseException ),
-          _GF_MG_EXCEPTION_ADD3( InvalidDeltaException ),
-          _GF_MG_EXCEPTION_ADD3( KeyNotFoundException ),
-          _GF_MG_EXCEPTION_ADD3( CommitConflictException ),
-          _GF_MG_EXCEPTION_ADD3( TransactionDataNodeHasDepartedException ),
-          _GF_MG_EXCEPTION_ADD3( TransactionDataRebalancedException )
+          { "apache::geode::client::" "AssertionException", gcnew CreateException2( AssertionException::Create ) },
+          { "apache::geode::client::" "IllegalArgumentException", gcnew CreateException2( IllegalArgumentException::Create ) },
+          { "apache::geode::client::" "IllegalStateException", gcnew CreateException2( IllegalStateException::Create ) },
+          { "apache::geode::client::" "CacheExistsException", gcnew CreateException2( CacheExistsException::Create ) },
+          { "apache::geode::client::" "CacheXmlException", gcnew CreateException2( CacheXmlException::Create ) },
+          { "apache::geode::client::" "TimeoutException", gcnew CreateException2( TimeoutException::Create ) },
+          { "apache::geode::client::" "CacheWriterException", gcnew CreateException2( CacheWriterException::Create ) },
+          { "apache::geode::client::" "CacheListenerException", gcnew CreateException2( CacheListenerException::Create ) },
+          { "apache::geode::client::" "RegionExistsException", gcnew CreateException2( RegionExistsException::Create ) },
+          { "apache::geode::client::" "CacheClosedException", gcnew CreateException2( CacheClosedException::Create ) },
+          { "apache::geode::client::" "LeaseExpiredException", gcnew CreateException2( LeaseExpiredException::Create ) },
+          { "apache::geode::client::" "CacheLoaderException", gcnew CreateException2( CacheLoaderException::Create ) },
+          { "apache::geode::client::" "RegionDestroyedException", gcnew CreateException2( RegionDestroyedException::Create ) },
+          { "apache::geode::client::" "EntryDestroyedException", gcnew CreateException2( EntryDestroyedException::Create ) },
+          { "apache::geode::client::" "NoSystemException", gcnew CreateException2( NoSystemException::Create ) },
+          { "apache::geode::client::" "AlreadyConnectedException", gcnew CreateException2( AlreadyConnectedException::Create ) },
+          { "apache::geode::client::" "FileNotFoundException", gcnew CreateException2( FileNotFoundException::Create ) },          
+          { "apache::geode::client::" "InterruptedException", gcnew CreateException2( InterruptedException::Create ) },
+          { "apache::geode::client::" "UnsupportedOperationException", gcnew CreateException2( UnsupportedOperationException::Create ) },
+          { "apache::geode::client::" "StatisticsDisabledException", gcnew CreateException2( StatisticsDisabledException::Create ) },
+          { "apache::geode::client::" "ConcurrentModificationException", gcnew CreateException2( ConcurrentModificationException::Create ) },
+          { "apache::geode::client::" "UnknownException", gcnew CreateException2( UnknownException::Create ) },
+          { "apache::geode::client::" "ClassCastException", gcnew CreateException2( ClassCastException::Create ) },
+          { "apache::geode::client::" "EntryNotFoundException", gcnew CreateException2( EntryNotFoundException::Create ) },
+          { "apache::geode::client::" "GeodeIOException", gcnew CreateException2( GeodeIOException::Create ) },
+          { "apache::geode::client::" "GeodeConfigException", gcnew CreateException2( GeodeConfigException::Create ) },
+          { "apache::geode::client::" "NullPointerException", gcnew CreateException2( NullPointerException::Create ) },
+          { "apache::geode::client::" "EntryExistsException", gcnew CreateException2( EntryExistsException::Create ) },
+          { "apache::geode::client::" "NotConnectedException", gcnew CreateException2( NotConnectedException::Create ) },
+          { "apache::geode::client::" "CacheProxyException", gcnew CreateException2( CacheProxyException::Create ) },
+          { "apache::geode::client::" "OutOfMemoryException", gcnew CreateException2( OutOfMemoryException::Create ) },
+          { "apache::geode::client::" "NotOwnerException", gcnew CreateException2( NotOwnerException::Create ) },
+          { "apache::geode::client::" "WrongRegionScopeException", gcnew CreateException2( WrongRegionScopeException::Create ) },
+          { "apache::geode::client::" "BufferSizeExceededException", gcnew CreateException2( BufferSizeExceededException::Create ) },
+          { "apache::geode::client::" "RegionCreationFailedException", gcnew CreateException2( RegionCreationFailedException::Create ) },
+          { "apache::geode::client::" "FatalInternalException", gcnew CreateException2( FatalInternalException::Create ) },
+          { "apache::geode::client::" "DiskFailureException", gcnew CreateException2( DiskFailureException::Create ) },
+          { "apache::geode::client::" "DiskCorruptException", gcnew CreateException2( DiskCorruptException::Create ) },
+          { "apache::geode::client::" "InitFailedException", gcnew CreateException2( InitFailedException::Create ) },
+          { "apache::geode::client::" "ShutdownFailedException", gcnew CreateException2( ShutdownFailedException::Create ) },
+          { "apache::geode::client::" "CacheServerException", gcnew CreateException2( CacheServerException::Create ) },
+          { "apache::geode::client::" "OutOfRangeException", gcnew CreateException2( OutOfRangeException::Create ) },
+          { "apache::geode::client::" "QueryException", gcnew CreateException2( QueryException::Create ) },
+          { "apache::geode::client::" "MessageException", gcnew CreateException2( MessageException::Create ) },
+          { "apache::geode::client::" "NotAuthorizedException", gcnew CreateException2( NotAuthorizedException::Create ) },
+          { "apache::geode::client::" "AuthenticationFailedException", gcnew CreateException2( AuthenticationFailedException::Create ) },
+          { "apache::geode::client::" "AuthenticationRequiredException", gcnew CreateException2( AuthenticationRequiredException::Create ) },
+          { "apache::geode::client::" "DuplicateDurableClientException", gcnew CreateException2( DuplicateDurableClientException::Create ) },
+          { "apache::geode::client::" "NoAvailableLocatorsException", gcnew CreateException2( NoAvailableLocatorsException::Create ) },
+          { "apache::geode::client::" "FunctionExecutionException", gcnew CreateException2( FunctionExecutionException::Create ) },
+          { "apache::geode::client::" "CqInvalidException", gcnew CreateException2( CqInvalidException::Create ) },
+          { "apache::geode::client::" "CqExistsException", gcnew CreateException2( CqExistsException::Create ) },
+          { "apache::geode::client::" "CqQueryException", gcnew CreateException2( CqQueryException::Create ) },
+          { "apache::geode::client::" "CqClosedException", gcnew CreateException2( CqClosedException::Create ) },
+          { "apache::geode::client::" "CqException", gcnew CreateException2( CqException::Create ) },
+          { "apache::geode::client::" "AllConnectionsInUseException", gcnew CreateException2( AllConnectionsInUseException::Create ) },
+          { "apache::geode::client::" "InvalidDeltaException", gcnew CreateException2( InvalidDeltaException::Create ) },
+          { "apache::geode::client::" "KeyNotFoundException", gcnew CreateException2( KeyNotFoundException::Create ) },
+          { "apache::geode::client::" "CommitConflictException", gcnew CreateException2( CommitConflictException::Create ) },
+          { "apache::geode::client::" "TransactionDataNodeHasDepartedException", gcnew CreateException2( TransactionDataNodeHasDepartedException::Create ) },
+          { "apache::geode::client::" "TransactionDataRebalancedException", gcnew CreateException2( TransactionDataRebalancedException::Create ) }
         };
 
         Native2ManagedExMap = gcnew Dictionary<String^, CreateException2^>( );
diff --git a/clicache/src/ExceptionTypes.hpp b/clicache/src/ExceptionTypes.hpp
index fb31b20..00a9716 100644
--- a/clicache/src/ExceptionTypes.hpp
+++ b/clicache/src/ExceptionTypes.hpp
@@ -266,20 +266,6 @@ namespace Apache
           : Exception( info, context ) { }
       };
 
-/// Handle geode exceptions from native layer and convert to managed
-/// exceptions.
-#define _GF_MG_EXCEPTION_TRY2        \
-      try {
-#define _GF_MG_EXCEPTION_CATCH_ALL2  \
-      } \
-      catch (const apache::geode::client::Exception& ex) { \
-      throw Apache::Geode::Client::GeodeException::Get(ex); \
-      } \
-      catch (System::AccessViolationException^ ex) { \
-        throw ex; \
-      }
-
-
 /// Creates a class <c>x</c> named for each exception <c>y</c>.
 #define _GF_MG_EXCEPTION_DEF4(x,y) \
       [Serializable] \
diff --git a/clicache/src/Execution.cpp b/clicache/src/Execution.cpp
index b56a24e..b30ccc3 100644
--- a/clicache/src/Execution.cpp
+++ b/clicache/src/Execution.cpp
@@ -42,7 +42,7 @@ namespace Apache
       Execution<TResult>^ Execution<TResult>::WithFilter(System::Collections::Generic::ICollection<TFilter>^ routingObj)
       {
         if (routingObj != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           auto rsptr = native::CacheableVector::create();
         
           for each(TFilter item in routingObj)
@@ -59,7 +59,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("Execution<TResult>::WithFilter: null TFilter provided");
@@ -70,7 +76,7 @@ namespace Apache
       generic<class TArgs>
       Execution<TResult>^ Execution<TResult>::WithArgs( TArgs args )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto argsptr = Serializable::GetUnmanagedValueGeneric<TArgs>( args );
@@ -80,13 +86,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ Execution<TResult>::WithCollector(Client::IResultCollector<TResult>^ rc)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           std::shared_ptr<native::ResultCollector> rcptr;
         if ( rc != nullptr ) {
           auto rcg = gcnew ResultCollectorGeneric<TResult>();
@@ -101,12 +113,18 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       generic<class TResult>
       IResultCollector<TResult>^ Execution<TResult>::Execute(String^ func, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         try
         {
           auto rc = m_nativeptr->get()->execute(to_utf8(func), TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -119,7 +137,13 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
diff --git a/clicache/src/FunctionService.cpp b/clicache/src/FunctionService.cpp
index 4540970..785b99e 100644
--- a/clicache/src/FunctionService.cpp
+++ b/clicache/src/FunctionService.cpp
@@ -41,41 +41,59 @@ namespace Apache
       generic <class TKey, class TValue>
       Execution<TResult>^ FunctionService<TResult>::OnRegion( IRegion<TKey, TValue>^ rg )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           
           auto nativeRegion = ((Region<TKey, TValue>^)rg)->GetNative();
           auto execution = native::FunctionService::onRegion(nativeRegion);
           return Execution<TResult>::Create( std::move(execution), nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic <class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServer( Pool^ pl )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto nativeptr = native::FunctionService::onServer(pl->GetNative());
           return Execution<TResult>::Create(std::move(nativeptr) , nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       
       generic <class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServers( Pool^ pl )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto nativeptr = native::FunctionService::onServers(pl->GetNative());
           return Execution<TResult>::Create(std::move(nativeptr) , nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServer( IRegionService^ cache )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           if(auto realCache = dynamic_cast<Cache^>(cache))
           {
@@ -89,13 +107,19 @@ namespace Apache
             return Execution<TResult>::Create(std::move(nativeptr), nullptr );
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServers( IRegionService^ cache )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           if(auto realCache = dynamic_cast<Cache^>(cache))
           {
@@ -109,7 +133,13 @@ namespace Apache
             return Execution<TResult>::Create(std::move(nativeptr), nullptr );
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/LocalRegion.cpp b/clicache/src/LocalRegion.cpp
index 6a81cb4..a904f70 100644
--- a/clicache/src/LocalRegion.cpp
+++ b/clicache/src/LocalRegion.cpp
@@ -64,7 +64,7 @@ namespace Apache
       generic<class TKey, class TValue>
       std::shared_ptr<apache::geode::client::Serializable> LocalRegion<TKey, TValue>::getRegionEntryValue(std::shared_ptr<apache::geode::client::CacheableKey>& keyptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             if (auto entryPtr = m_nativeptr->get()->getEntry(keyptr)) {
@@ -78,13 +78,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Put(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -98,7 +104,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -123,7 +135,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::default::set(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -136,7 +148,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -145,7 +163,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -156,7 +174,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         auto toArray = gcnew array<KeyValuePair<TKey,TValue>>(static_cast<int>(vc.size()));
         for( System::Int32 index = 0; index < vc.size( ); index++ )
@@ -175,7 +199,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -186,7 +210,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
         for( System::Int32 index = 0; index < vc.size( ); index++ )
@@ -215,7 +245,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::ContainsKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -227,7 +257,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -248,7 +284,7 @@ namespace Apache
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ LocalRegion<TKey, TValue>::Keys::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<apache::geode::client::CacheableKey>> vc;
         try
@@ -269,13 +305,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TValue>^ LocalRegion<TKey, TValue>::Values::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::Cacheable>> vc;
           try
@@ -297,13 +339,19 @@ namespace Apache
           auto collectionlist = (System::Collections::Generic::ICollection<TValue>^)valarr;
           return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -316,13 +364,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -335,13 +389,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-       _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+       }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(TKey key, TValue value, Object^ callbackArg)
       {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
           try
           {
@@ -355,13 +415,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -378,14 +444,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove( TKey key, Object^ callbackArg )
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
            try
            {
              std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
@@ -401,13 +473,19 @@ namespace Apache
            {
              GC::KeepAlive(m_nativeptr);
            }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(KeyValuePair<TKey,TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -420,13 +498,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -440,23 +524,35 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::InvalidateRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           InvalidateRegion( nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::InvalidateRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -468,23 +564,35 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::DestroyRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           DestroyRegion( nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::DestroyRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
@@ -494,24 +602,36 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Invalidate(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
          Invalidate(key, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Invalidate(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -524,7 +644,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -613,7 +739,7 @@ namespace Apache
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::ParentRegion::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -628,13 +754,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ LocalRegion<TKey, TValue>::Attributes::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -645,13 +777,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       AttributesMutator<TKey, TValue>^ LocalRegion<TKey, TValue>::AttributesMutator::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -662,13 +800,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::CacheStatistics^ LocalRegion<TKey, TValue>::Statistics::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -679,13 +823,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::GetSubRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -701,14 +851,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::CreateSubRegion( String^ subRegionName,
         Apache::Geode::Client::RegionAttributes<TKey, TValue>^ attributes)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -721,14 +877,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^ LocalRegion<TKey, TValue>::SubRegions( bool recursive )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::Region>> vsr;
           try
@@ -750,13 +912,19 @@ namespace Apache
           auto collection = (System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^)subRegions;
           return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       RegionEntry<TKey, TValue>^ LocalRegion<TKey, TValue>::GetEntry( TKey key )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -769,13 +937,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^ LocalRegion<TKey, TValue>::GetEntries(bool recursive)
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
           try
@@ -796,7 +970,13 @@ namespace Apache
           auto collection = (System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^)entryarr;
           return collection;
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -809,7 +989,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::ContainsValueForKey( TKey key )
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
 
            try
            {
@@ -821,7 +1001,13 @@ namespace Apache
              GC::KeepAlive(m_nativeptr);
            }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -846,7 +1032,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Clear(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->localClear(Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg ) );
@@ -855,7 +1041,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
 
@@ -872,7 +1064,7 @@ namespace Apache
           throw gcnew System::ArgumentOutOfRangeException;
         }
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
         try
@@ -898,7 +1090,13 @@ namespace Apache
           ++startIdx;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/Log.cpp b/clicache/src/Log.cpp
index 4264fd4..2b8cbec 100644
--- a/clicache/src/Log.cpp
+++ b/clicache/src/Log.cpp
@@ -34,24 +34,36 @@ namespace Apache
 
       void Log::Init(LogLevel level, String^ logFileName)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_lfname(logFileName);
         apache::geode::client::Log::init(static_cast<apache::geode::client::LogLevel>(level),
                                          mg_lfname.CharPtr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::Init(LogLevel level, String^ logFileName, System::Int32 logFileLimit)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_lfname(logFileName);
         apache::geode::client::Log::init(static_cast<apache::geode::client::LogLevel>(level),
                                          mg_lfname.CharPtr, logFileLimit);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::Close()
@@ -78,13 +90,19 @@ namespace Apache
 
       void Log::Write(LogLevel level, String^ msg)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_msg(msg);
         apache::geode::client::Log::log(static_cast<apache::geode::client::LogLevel>(level),
                                         mg_msg.CharPtr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::LogThrow(LogLevel level, String^ msg, System::Exception^ ex)
diff --git a/clicache/src/Pool.cpp b/clicache/src/Pool.cpp
index 2a30503..f269e96 100644
--- a/clicache/src/Pool.cpp
+++ b/clicache/src/Pool.cpp
@@ -451,7 +451,7 @@ namespace Apache
 
       QueryService^ Pool::GetQueryService()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -463,12 +463,18 @@ namespace Apache
           }
 
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       
       Int32 Pool::PendingEventCount::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -480,7 +486,13 @@ namespace Apache
           }
 
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/PoolFactory.cpp b/clicache/src/PoolFactory.cpp
index 9c62562..15e7f30 100644
--- a/clicache/src/PoolFactory.cpp
+++ b/clicache/src/PoolFactory.cpp
@@ -37,7 +37,7 @@ namespace Apache
 
       PoolFactory^ PoolFactory::SetFreeConnectionTimeout( TimeSpan connectionTimeout )
 		  {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -48,14 +48,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetLoadConditioningInterval( TimeSpan loadConditioningInterval )
 		  {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -66,14 +72,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSocketBufferSize( Int32 bufferSize )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -84,14 +96,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetReadTimeout( TimeSpan timeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -102,14 +120,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetMinConnections( Int32 minConnections )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -120,14 +144,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetMaxConnections( Int32 maxConnections )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -138,14 +168,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetIdleTimeout( TimeSpan idleTimeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -156,14 +192,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetRetryAttempts( Int32 retryAttempts )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -174,14 +216,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetPingInterval( TimeSpan pingInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -192,14 +240,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetUpdateLocatorListInterval( TimeSpan updateLocatorListInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -210,14 +264,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       PoolFactory^ PoolFactory::SetStatisticInterval( TimeSpan statisticInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -228,13 +288,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
       PoolFactory^ PoolFactory::SetServerGroup( String^ group )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -245,14 +311,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::AddLocator( String^ host, Int32 port )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -263,14 +335,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       PoolFactory^ PoolFactory::AddServer( String^ host, Int32 port )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -281,13 +359,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 		  PoolFactory^ PoolFactory::SetSniProxy(String^ hostname, Int32 port)
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -298,13 +382,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 		  PoolFactory^ PoolFactory::SetSubscriptionEnabled( Boolean enabled )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -315,14 +405,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
           PoolFactory^ PoolFactory::SetPRSingleHopEnabled( Boolean enabled )
           {
-            _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+            try {/* due to auto replace */
 
               try
               {
@@ -333,14 +429,20 @@ namespace Apache
                 GC::KeepAlive(m_nativeptr);
               }
 
-             _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+             }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
                return this;
           }
 
     
 		  PoolFactory^ PoolFactory::SetSubscriptionRedundancy( Int32 redundancy )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -351,14 +453,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSubscriptionMessageTrackingTimeout( TimeSpan messageTrackingTimeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -369,14 +477,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSubscriptionAckInterval( TimeSpan ackInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -387,12 +501,18 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
       PoolFactory^ PoolFactory::SetThreadLocalConnections( Boolean enabled )
       {
-			  _GF_MG_EXCEPTION_TRY2
+			  try {
 
 			  try
 			  {
@@ -403,13 +523,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
           return this;
 	  }
 
       PoolFactory^ PoolFactory::SetMultiuserAuthentication( bool multiuserAuthentication )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
           try
           {
@@ -420,14 +546,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 	   }
 
 
 		  PoolFactory^ PoolFactory::Reset()
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -438,14 +570,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       Pool^ PoolFactory::Create(String^ name)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -456,7 +594,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
         
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/Properties.cpp b/clicache/src/Properties.cpp
index dc37432..e359c29 100644
--- a/clicache/src/Properties.cpp
+++ b/clicache/src/Properties.cpp
@@ -86,7 +86,7 @@ namespace Apache
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key, true);
         std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TPropValue>(value, true);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -97,7 +97,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -105,7 +111,7 @@ namespace Apache
       {
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -116,7 +122,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -132,7 +144,7 @@ namespace Apache
           auto otherVisitor = gcnew PropertyVisitor(proxy, &PropertyVisitorProxy<TPropKey, TPropValue>::Visit);
           mg_visitor.setptr(otherVisitor);
 
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
             try
             {
@@ -143,14 +155,20 @@ namespace Apache
               GC::KeepAlive(m_nativeptr);
             }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
       }
 
       generic<class TPropKey, class TPropValue>
       System::UInt32 Properties<TPropKey, TPropValue>::Size::get( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -161,13 +179,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::AddAll( Properties<TPropKey, TPropValue>^ other )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -178,13 +202,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::Load( String^ fileName )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -195,7 +225,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -219,11 +255,17 @@ namespace Apache
           auto nativeOutput = output->GetNative();
           if (nativeOutput != nullptr)
           {
-            _GF_MG_EXCEPTION_TRY2
+            try {
 
                 m_nativeptr->get()->toData(*nativeOutput);
 
-            _GF_MG_EXCEPTION_CATCH_ALL2
+            }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
           }
 
           if (output->IsManagedObject()) {
@@ -258,7 +300,7 @@ namespace Apache
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::FromData( native::DataInput& input )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -269,14 +311,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       System::UInt64 Properties<TPropKey, TPropValue>::ObjectSize::get( )
       {
         //TODO::
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -287,7 +335,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       // ISerializable methods
@@ -298,7 +352,7 @@ namespace Apache
       //{
       //  auto output = std::unique_ptr<native::DataOutput>(new native::DataOutput(*m_serializationRegistry->get_shared_ptr()));
 
-      //  _GF_MG_EXCEPTION_TRY2
+      //  try {
 
       //    try
       //    {
@@ -309,7 +363,13 @@ namespace Apache
       //      GC::KeepAlive(m_nativeptr);
       //    }
 
-      //  _GF_MG_EXCEPTION_CATCH_ALL2
+      //  }
+      //  catch (const apache::geode::client::Exception& ex) {
+      //    throw Apache::Geode::Client::GeodeException::Get(ex);
+      //  }
+      //  catch (System::AccessViolationException^ ex) {
+      //    throw ex;
+      //  }
 
       //  auto bytes = gcnew array<Byte>( output->getBufferLength( ) );
       //  {
@@ -336,11 +396,17 @@ namespace Apache
       //  if (bytes != nullptr) {
       //    pin_ptr<const Byte> pin_bytes = &bytes[0];
 
-      //    _GF_MG_EXCEPTION_TRY2
+      //    try {
 
       //      native::DataInput input( (System::Byte*)pin_bytes, bytes->Length, *CacheImpl::getInstance()->getSerializationRegistry().get());
       //      FromData(input);
-      //    _GF_MG_EXCEPTION_CATCH_ALL2
+      //    }
+      //    catch (const apache::geode::client::Exception& ex) {
+      //      throw Apache::Geode::Client::GeodeException::Get(ex);
+      //    }
+      //    catch (System::AccessViolationException^ ex) {
+      //      throw ex;
+      //    }
       //  }
       //}
 
diff --git a/clicache/src/Query.cpp b/clicache/src/Query.cpp
index 18393c4..001c125 100644
--- a/clicache/src/Query.cpp
+++ b/clicache/src/Query.cpp
@@ -47,7 +47,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Query<TResult>::Execute( TimeSpan timeout )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -58,7 +58,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }        
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 	
       generic<class TResult>
@@ -70,7 +76,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Query<TResult>::Execute( array<Object^>^ paramList, TimeSpan timeout )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto rsptr = apache::geode::client::CacheableVector::create();
           for( int index = 0; index < paramList->Length; index++ )
@@ -88,7 +94,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
@@ -124,7 +136,7 @@ namespace Apache
       generic<class TResult>
       void Query<TResult>::Compile( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -135,13 +147,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       bool Query<TResult>::IsCompiled::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -152,7 +170,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/Region.cpp b/clicache/src/Region.cpp
index c98bf82..a29252e 100644
--- a/clicache/src/Region.cpp
+++ b/clicache/src/Region.cpp
@@ -79,7 +79,7 @@ namespace Apache
       generic<class TKey, class TValue>
       std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr, std::shared_ptr<native::Serializable>& callbackptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->get(keyptr, callbackptr);
@@ -88,13 +88,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->get(keyptr);
@@ -103,13 +109,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::isPoolInMultiuserMode()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           auto rAttributes = this->Attributes;
           auto poolName = rAttributes->PoolName;
           if (poolName != nullptr) {
@@ -120,13 +132,19 @@ namespace Apache
             }
           }
           return false;
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Put(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -140,7 +158,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -166,7 +190,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::default::set(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -179,7 +203,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -188,7 +218,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -199,7 +229,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
           auto toArray = gcnew array<KeyValuePair<TKey, TValue>>(static_cast<int>(vc.size()));
 
@@ -219,7 +255,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -230,7 +266,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
          auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
 
@@ -261,7 +303,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ContainsKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -273,13 +315,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::TryGetValue(TKey key, TValue %val)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
         GC::KeepAlive(m_nativeptr);
         auto nativeptr = this->get(keyptr);
@@ -292,13 +340,19 @@ namespace Apache
           return true;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ Region<TKey, TValue>::Keys::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vc;
         try
@@ -318,13 +372,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TValue>^ Region<TKey, TValue>::Values::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::Cacheable>> vc;
         try
@@ -344,13 +404,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TValue>^)valarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -363,13 +429,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -382,13 +454,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -402,13 +480,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -420,14 +504,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -440,13 +530,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -459,13 +555,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -480,23 +582,35 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::InvalidateRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           InvalidateRegion(nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::InvalidateRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -508,23 +622,35 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::DestroyRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           DestroyRegion(nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::DestroyRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -536,24 +662,36 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Invalidate(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           Invalidate(key, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Invalidate(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -566,24 +704,36 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           return PutAll(map, TimeUtils::DurationToTimeSpan(native::DEFAULT_RESPONSE_TIMEOUT));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           native::HashMapOfCacheable nativeMap;
         for each (KeyValuePair<TKey, TValue> keyValPair in map)
@@ -601,14 +751,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map, TimeSpan timeout, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           native::HashMapOfCacheable nativeMap;
         for each (KeyValuePair<TKey, TValue> keyValPair in map)
@@ -627,7 +783,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -636,11 +798,17 @@ namespace Apache
                                         System::Collections::Generic::IDictionary<TKey, TValue>^ values,
                                         System::Collections::Generic::IDictionary<TKey, System::Exception^>^ exceptions)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           GetAll(keys, values, exceptions, false);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -651,7 +819,7 @@ namespace Apache
                                         bool addToLocalCache)
       {
         if (keys != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -679,7 +847,13 @@ namespace Apache
             }
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("GetAll: null keys provided");
@@ -693,7 +867,7 @@ namespace Apache
                                         bool addToLocalCache, Object^ callbackArg)
       {
         if (keys != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
           std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -725,7 +899,13 @@ namespace Apache
             }
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("GetAll: null keys provided");
@@ -735,11 +915,17 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::RemoveAll(System::Collections::Generic::ICollection<TKey>^ keys)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           RemoveAll(keys, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -747,7 +933,7 @@ namespace Apache
       void Region<TKey, TValue>::RemoveAll(System::Collections::Generic::ICollection<TKey>^ keys,
                                             Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
         for each(TKey item in keys) 
@@ -767,7 +953,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
       generic<class TKey, class TValue>
@@ -799,7 +991,7 @@ namespace Apache
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::ParentRegion::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -811,13 +1003,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ Region<TKey, TValue>::Attributes::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -829,13 +1027,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       AttributesMutator<TKey, TValue>^ Region<TKey, TValue>::AttributesMutator::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -847,13 +1051,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::CacheStatistics^ Region<TKey, TValue>::Statistics::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -865,13 +1075,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::GetSubRegion(String^ path)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -883,14 +1099,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::CreateSubRegion(String^ subRegionName,
                                                                     Apache::Geode::Client::RegionAttributes<TKey, TValue>^ attributes)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -902,14 +1124,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^ Region<TKey, TValue>::SubRegions(bool recursive)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<native::Region>> vsr;
         try
@@ -931,13 +1159,19 @@ namespace Apache
         auto collection = (System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^)subRegions;
         return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       RegionEntry<TKey, TValue>^ Region<TKey, TValue>::GetEntry(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -950,13 +1184,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^ Region<TKey, TValue>::GetEntries(bool recursive)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
         try
@@ -978,7 +1218,13 @@ namespace Apache
 
         return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -991,7 +1237,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ContainsValueForKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1003,13 +1249,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       int Region<TKey, TValue>::Count::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->size();
@@ -1018,7 +1270,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1030,7 +1288,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Clear(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         try
         {
           std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
@@ -1040,7 +1298,13 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1056,7 +1320,7 @@ namespace Apache
           throw gcnew System::ArgumentOutOfRangeException;
         }
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
         try
@@ -1082,7 +1346,13 @@ namespace Apache
           ++startIdx;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1118,7 +1388,7 @@ namespace Apache
       {
         if (keys != nullptr)
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -1136,7 +1406,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
       }
 
@@ -1145,7 +1421,7 @@ namespace Apache
       {
         if (keys != nullptr)
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -1164,7 +1440,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
       }
 
@@ -1192,7 +1474,7 @@ namespace Apache
                                                   bool getInitialValues,
                                                   bool receiveValues)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1203,13 +1485,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ Region<TKey, TValue>::GetInterestList()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vc;
         try
@@ -1230,13 +1518,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<String^>^ Region<TKey, TValue>::GetInterestListRegex()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableString>> vc;
         try
@@ -1256,13 +1550,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<String^>^)strarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::UnregisterAllKeys()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1273,7 +1573,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -1299,7 +1605,7 @@ namespace Apache
       void Region<TKey, TValue>::RegisterRegex(String^ regex, bool isDurable,
           bool getInitialValues, bool receiveValues)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1311,13 +1617,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::UnregisterRegex(String^ regex)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1328,7 +1640,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -1343,7 +1661,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Region<TKey, TValue>::Query(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1363,7 +1681,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1375,7 +1699,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ExistsValue(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1386,7 +1710,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1398,7 +1728,7 @@ namespace Apache
       generic<class TKey, class TValue>
       Object^ Region<TKey, TValue>::SelectValue(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1410,7 +1740,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/RegionAttributesFactory.cpp b/clicache/src/RegionAttributesFactory.cpp
index e8bd4aa..45d2299 100644
--- a/clicache/src/RegionAttributesFactory.cpp
+++ b/clicache/src/RegionAttributesFactory.cpp
@@ -357,7 +357,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetInitialCapacity( System::Int32 initialCapacity )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -368,7 +368,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -376,7 +382,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetLoadFactor( Single loadFactor )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -387,7 +393,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -395,7 +407,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetConcurrencyLevel( System::Int32 concurrencyLevel )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -406,7 +418,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -485,7 +503,7 @@ namespace Apache
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::Create()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -497,7 +515,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/RegionFactory.cpp b/clicache/src/RegionFactory.cpp
index d269f73..ad60f79 100644
--- a/clicache/src/RegionFactory.cpp
+++ b/clicache/src/RegionFactory.cpp
@@ -237,7 +237,7 @@ namespace Apache
 
       RegionFactory^ RegionFactory::SetInitialCapacity( System::Int32 initialCapacity )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -249,12 +249,18 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetLoadFactor( Single loadFactor )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -266,12 +272,18 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetConcurrencyLevel( System::Int32 concurrencyLevel )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -283,7 +295,13 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetLruEntriesLimit( System::UInt32 entriesLimit )
@@ -355,7 +373,7 @@ namespace Apache
       generic <class TKey, class TValue>
       IRegion<TKey,TValue>^ RegionFactory::Create(String^ regionName)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -367,7 +385,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic <class TKey, class TValue>
diff --git a/clicache/src/ResultCollector.cpp b/clicache/src/ResultCollector.cpp
index 68f8d61..66798af 100644
--- a/clicache/src/ResultCollector.cpp
+++ b/clicache/src/ResultCollector.cpp
@@ -48,7 +48,7 @@ namespace Apache
       generic<class TResult>
       System::Collections::Generic::ICollection<TResult>^  ResultCollector<TResult>::GetResult(TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto results = m_nativeptr->get()->getResult(TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -66,13 +66,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       void ResultCollector<TResult>::EndResults()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->endResults();
@@ -81,13 +87,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       void ResultCollector<TResult>::ClearResults(/*bool*/)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->clearResults();
@@ -96,7 +108,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/StructSet.cpp b/clicache/src/StructSet.cpp
index 185b36b..2c79265 100644
--- a/clicache/src/StructSet.cpp
+++ b/clicache/src/StructSet.cpp
@@ -72,7 +72,7 @@ namespace Apache
       generic<class TResult>
       int32_t StructSet<TResult>::GetFieldIndex( String^ fieldName )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -83,7 +83,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
diff --git a/clicache/src/TypeRegistry.cpp b/clicache/src/TypeRegistry.cpp
index ea257b2..2315b41 100644
--- a/clicache/src/TypeRegistry.cpp
+++ b/clicache/src/TypeRegistry.cpp
@@ -223,12 +223,18 @@ namespace Apache
           ManagedTypeToDsCode[managedType] = dsCode;
         }
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
           auto&& serializationRegistry = CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry();
           auto nativeDelegateFunction = static_cast<std::shared_ptr<native::Serializable>(*)()>(
               System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(nativeDelegate).ToPointer());
           serializationRegistry->setDataSerializablePrimitiveType(nativeDelegateFunction, static_cast<DSCode>(dsCode));
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::RegisterDataSerializableFixedIdTypeOverrideNativeDeserialization(
@@ -246,22 +252,34 @@ namespace Apache
 
         Log::Finer("Registering serializable fixed ID " + fixedId);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
           auto&& serializationRegistry = CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry();
           auto nativeDelegateFunction = static_cast<std::shared_ptr<native::Serializable>(*)()>(
               System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(nativeDelegate).ToPointer());
           serializationRegistry->addDataSerializableFixedIdType(static_cast<internal::DSFid>(fixedId), nativeDelegateFunction);
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::UnregisterTypeGeneric(Byte typeId)
       {
         DsCodeToDataSerializablePrimitiveNativeDelegate->Remove(typeId);
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry()->removeDataSerializableType(typeId);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::RegisterDataSerializablePrimitiveWrapper(
diff --git a/clicache/src/UserFunctionExecutionException.cpp b/clicache/src/UserFunctionExecutionException.cpp
index abec0c7..869ffc6 100644
--- a/clicache/src/UserFunctionExecutionException.cpp
+++ b/clicache/src/UserFunctionExecutionException.cpp
@@ -37,7 +37,7 @@ namespace Apache
 
       String^ UserFunctionExecutionException::Message::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -49,12 +49,18 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       String^ UserFunctionExecutionException::Name::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -66,7 +72,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/impl/AuthenticatedView.cpp b/clicache/src/impl/AuthenticatedView.cpp
index 3c91d54..7830a33 100644
--- a/clicache/src/impl/AuthenticatedView.cpp
+++ b/clicache/src/impl/AuthenticatedView.cpp
@@ -56,7 +56,7 @@ namespace Apache
 
       void AuthenticatedView::Close( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -67,14 +67,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       
 			//TODO::split
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ AuthenticatedView::GetRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -86,12 +92,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       
       Client::QueryService^ AuthenticatedView::GetQueryService( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -102,7 +114,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/impl/GeodeDataInputStream.hpp b/clicache/src/impl/GeodeDataInputStream.hpp
index 138c542..bb2f1fe 100644
--- a/clicache/src/impl/GeodeDataInputStream.hpp
+++ b/clicache/src/impl/GeodeDataInputStream.hpp
@@ -97,7 +97,7 @@ namespace Apache
 
         virtual int Read(array<Byte> ^ buffer, int offset, int count) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           auto bytesRemaining = static_cast<int>(m_maxSize - m_buffer->BytesReadInternally);
 					if(bytesRemaining <= 0)
 						return bytesRemaining;
@@ -114,7 +114,13 @@ namespace Apache
             m_position += actual;
           }
           return actual;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual void Flush() override { /* do nothing */ }
diff --git a/clicache/src/impl/GeodeDataOutputStream.hpp b/clicache/src/impl/GeodeDataOutputStream.hpp
index 6c7ed02..5bed23c 100644
--- a/clicache/src/impl/GeodeDataOutputStream.hpp
+++ b/clicache/src/impl/GeodeDataOutputStream.hpp
@@ -81,7 +81,7 @@ namespace Apache
 
         virtual void Write(array<Byte> ^ buffer, int offset, int count) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           /*
           array<Byte> ^ chunk = gcnew array<Byte>(count);
           array<Byte>::ConstrainedCopy(buffer, offset, chunk, 0, count);
@@ -91,15 +91,27 @@ namespace Apache
           //m_buffer->NativePtr->writeBytesOnly((const System::Byte*)pin_bytes, count);
           m_buffer->WriteBytesOnly(buffer, count, offset);
           m_position += count;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual void WriteByte(unsigned char value) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           m_buffer->WriteByte(value);
           m_position++;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual int Read(array<Byte> ^ buffer, int offset, int count) override