[mapguide-commits] r7452 - in trunk/MgDev: Common/Foundation/Exception Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Apr 7 23:05:25 PDT 2013


Author: jng
Date: 2013-04-07 23:05:24 -0700 (Sun, 07 Apr 2013)
New Revision: 7452

Modified:
   trunk/MgDev/Common/Foundation/Exception/Exception.cpp
   trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp
Log:
#2218: Merge r7448 from 2.5 branch
#2251: Merge r7447 from 2.5 branch

Modified: trunk/MgDev/Common/Foundation/Exception/Exception.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2013-04-06 18:37:27 UTC (rev 7451)
+++ trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2013-04-08 06:05:24 UTC (rev 7452)
@@ -534,6 +534,8 @@
         m_details = GetExceptionMessage(locale);
         m_details += L"\n";
         m_details += FormatDetails(locale);
+        m_details += L"\n";
+        m_details += FormatStackTrace(locale);
     }
 
     MG_CATCH_AND_RELEASE()

Modified: trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp	2013-04-06 18:37:27 UTC (rev 7451)
+++ trunk/MgDev/Server/src/Services/Feature/OpUpdateFeatures.cpp	2013-04-08 06:05:24 UTC (rev 7452)
@@ -55,6 +55,7 @@
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpUpdateFeatures::Execute()\n")));
 
     STRING partialFailureMsg;
+    Ptr<MgPropertyCollection> rowsAffected;
     MG_LOG_OPERATION_MESSAGE(L"UpdateFeatures");
 
     MG_FEATURE_SERVICE_TRY()
@@ -89,7 +90,7 @@
         Validate();
 
         // Execute the operation
-        Ptr<MgPropertyCollection> rowsAffected = m_service->UpdateFeatures(resource, commands, useTransaction);
+        rowsAffected = m_service->UpdateFeatures(resource, commands, useTransaction);
 
         // #649: Exceptions are only thrown in transactional cases (which will never reach here). For non-transactional cases, 
         // we check for any MgStringProperty instances. These are "serialized" FDO exception messages indicating failure for that 
@@ -138,13 +139,18 @@
     {
         // Failed operation
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
-        // Only thrown exceptions are logged, so for this partial failure to be logged into Error.log it needs to be
-        // wrapped in an MgException to be thrown at the end of this method
+        // Only thrown exceptions are logged, so for this partial failure to be logged into Error.log
+        // we have to log it here
         if (mgException == NULL && !partialFailureMsg.empty())
         {
-            MgStringCollection args;
-            args.Add(partialFailureMsg);
-            mgException = new MgFeatureServiceException(L"MgOpUpdateFeatures.Execute", __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &args);
+            //NOTE: Serialized MgFdoException already has the stack trace, so stub an empty string to
+            //satisfy the logging macro
+            STRING sTrace = L"";
+            MG_LOG_EXCEPTION_ENTRY(partialFailureMsg, sTrace);
+
+            //DO NOT THROW A NEW EXCEPTION! We must respect the original contract of the API as perceived by the
+            //calling web tier code. That is: Write out the original MgPropertyCollection
+            EndExecution(rowsAffected);
         }
     }
 



More information about the mapguide-commits mailing list