[mapguide-commits] r9748 - in sandbox/jng/flatten_exceptions/Web/src: ApacheAgent CgiAgent DotNetUnmanagedApi DotNetUnmanagedApi/Foundation DotNetUnmanagedApi/Geometry DotNetUnmanagedApi/MapGuideCommon DotNetUnmanagedApi/PlatformBase HttpHandler IsapiAgent JavaApi JavaApiEx MapGuideApi PhpApi WebApp WebSupport

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Oct 21 08:20:59 PDT 2020


Author: jng
Date: 2020-10-21 08:20:56 -0700 (Wed, 21 Oct 2020)
New Revision: 9748

Modified:
   sandbox/jng/flatten_exceptions/Web/src/ApacheAgent/ApachePostParser.cpp
   sandbox/jng/flatten_exceptions/Web/src/CgiAgent/CgiPostParser.cpp
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml
   sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/catchall.code
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpClearTileCache.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateSession.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsIsValid.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBoundary.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBuffer.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoConvexHull.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoDistance.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSimplify.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoTessellate.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeometryInfo.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetLongTransactions.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetMapImage.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetPlot.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSessionTimeout.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSpatialContexts.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileImage.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileProviders.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetFeatures.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetLayer.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpPrimitiveValue.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequest.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpResourceExists.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpTestConnection.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWfsGetFeature.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWmsGetMap.cpp
   sandbox/jng/flatten_exceptions/Web/src/HttpHandler/ReaderByteSourceImpl.cpp
   sandbox/jng/flatten_exceptions/Web/src/IsapiAgent/IsapiPostParser.cpp
   sandbox/jng/flatten_exceptions/Web/src/JavaApi/catchall.code
   sandbox/jng/flatten_exceptions/Web/src/JavaApiEx/catchall.code
   sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/Constants.xml
   sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/MapGuideApiGen.xml
   sandbox/jng/flatten_exceptions/Web/src/PhpApi/catchall.code
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebCommand.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebFlyoutWidget.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebInvokeUrlCommand.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebLayout.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebPrintCommand.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebSearchCommand.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskBar.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskPane.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebApp/WebToolbar.cpp
   sandbox/jng/flatten_exceptions/Web/src/WebSupport/InitializeWebTier.cpp
Log:
Remove all exceptions from the rest of the web tier and modify all throws to throw MgException, passing an exception code instead. Remove all non-MgException classes from SWIG config files. Add MgExceptionCodes to SWIG constants files.

Modified: sandbox/jng/flatten_exceptions/Web/src/ApacheAgent/ApachePostParser.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/ApacheAgent/ApachePostParser.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/ApacheAgent/ApachePostParser.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -42,7 +42,7 @@
 
     if ( (rc = ap_setup_client_block(m_r, REQUEST_CHUNKED_ERROR)) != OK )
     {
-        throw new MgStreamIoException(L"ApachePostParser.Parse",
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -56,7 +56,7 @@
 
         if (totalBytes < 0 || totalBytes > (long)MAXPOSTSIZE)
         {
-            throw new MgStreamIoException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         m_pBuffer = (BYTE *)apr_pcalloc(m_r->pool, totalBytes + 1);
@@ -63,7 +63,7 @@
 
         if (NULL == m_pBuffer)
         {
-            throw new MgOutOfMemoryException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         while( (len_read = ap_get_client_block(m_r, argsbuffer, sizeof(argsbuffer))) > 0 )
@@ -166,7 +166,7 @@
     else
     {
         // Throw a better exception here?
-        throw new MgStreamIoException(L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"ApachePostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"ApachePostParser.Parse");

Modified: sandbox/jng/flatten_exceptions/Web/src/CgiAgent/CgiPostParser.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/CgiAgent/CgiPostParser.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/CgiAgent/CgiPostParser.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -69,7 +69,7 @@
         nBytes = atoi(contentLength);
         if (nBytes < 0 || nBytes > MAXPOSTSIZE)
         {
-            throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
 
         // Attempt to reuse the existing buffer if it's big enough.  If
@@ -90,7 +90,7 @@
 
             if (NULL == m_buf)
             {
-                throw new MgOutOfMemoryException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             m_bufSize = nBytes;
@@ -113,7 +113,7 @@
     if (readBytes != nBytes)
     {
         //TODO:  Better exception message?
-        throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     char* contentType = getenv(MapAgentStrings::ContentType);
@@ -289,7 +289,7 @@
         else
         {
             //TODO: throw a better exception here
-            throw new MgStreamIoException(L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgStreamIoException, L"CgiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationApiGen.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -112,56 +112,7 @@
     <Header path="../../../../Common/Foundation/Data/StringProperty.h" />
 
     <Header path="../../../../Common/Foundation/Exception/Exception.h" />
-    <Header path="../../../../Common/Foundation/Exception/SystemException.h" />
-    <Header path="../../../../Common/Foundation/Exception/IoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/FileIoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/StreamIoException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OutOfRangeException.h" />
 
-    <Header path="../../../../Common/Foundation/Exception/ApplicationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ArgumentOutOfRangeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ClassNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationLoadFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ConfigurationSaveFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DateTimeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DecryptionException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DirectoryNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DivideByZeroException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DomainException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateDirectoryException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateFileException.h" />
-    <Header path="../../../../Common/Foundation/Exception/DuplicateObjectException.h" />
-    <Header path="../../../../Common/Foundation/Exception/EncryptionException.h" />
-    <Header path="../../../../Common/Foundation/Exception/FileNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/IndexOutOfRangeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidArgumentException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidCastException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidOperationException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidPropertyTypeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/InvalidStreamHeaderException.h" />
-    <Header path="../../../../Common/Foundation/Exception/LengthException.h" />
-    <Header path="../../../../Common/Foundation/Exception/LogicException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NotFiniteNumberException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NotImplementedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullArgumentException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullPropertyValueException.h" />
-    <Header path="../../../../Common/Foundation/Exception/NullReferenceException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ObjectNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OutOfMemoryException.h" />
-    <Header path="../../../../Common/Foundation/Exception/OverflowException.h" />
-    <Header path="../../../../Common/Foundation/Exception/PlatformNotSupportedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourcesException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourcesLoadFailedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ResourceTagNotFoundException.h" />
-    <Header path="../../../../Common/Foundation/Exception/RuntimeException.h" />
-    <Header path="../../../../Common/Foundation/Exception/TemporaryFileNotAvailableException.h" />
-    <Header path="../../../../Common/Foundation/Exception/ThirdPartyException.h" />
-    <Header path="../../../../Common/Foundation/Exception/UnclassifiedException.h" />
-    <Header path="../../../../Common/Foundation/Exception/UnderflowException.h" />
-    <Header path="../../../../Common/Foundation/Exception/XmlException.h" />
-    <Header path="../../../../Common/Foundation/Exception/XmlParserException.h" />
-
 </Headers>
 
 </Parameters>

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Foundation/FoundationConstants.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -65,7 +65,7 @@
   <Class name="MgMimeType" />
   <Class name="MgPropertyType" />
   <Class name="MgFeaturePropertyType" />
-
+  <Class name="MgExceptionCodes" />
 </Classes>
 
 <!--
@@ -78,6 +78,7 @@
     <Header path="../../../../Common/Foundation/Data/FeaturePropertyType.h" />
     <Header path="../../../../Common/Foundation/Data/MimeType.h" />
     <Header path="../../../../Common/Foundation/Data/PropertyType.h" />
+    <Header path="../../../../Common/Foundation/Exception/ExceptionCodes.h" />
 </Headers>
 
 </Parameters>

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/Geometry/GeometryApiGen.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -174,17 +174,6 @@
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemTransform.h" />
     <Header path="../../../../Common/Geometry/CoordinateSystem/CoordinateSystemUnitInformation.h" />
 
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemComputationFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemConversionFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemLoadFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/CoordinateSystemTransformFailedException.h" />
-    <Header path="../../../../Common/Geometry/Exception/GeometryException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h" />
-    <Header path="../../../../Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h" />
-
 </Headers>
 
 </Parameters>

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/MapGuideCommon/MapGuideCommonApiGen.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -90,56 +90,6 @@
 
     <!-- MapGuideCommon classes -->
 
-    <Header path="../../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DbException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/LicenseException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnknownTileProviderException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UnsupportedTileProviderException.h" />
-    <Header path="../../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
-
     <Header path="../../../../Common/MapGuideCommon/Services/DrawingService.h" />
     <Header path="../../../../Common/MapGuideCommon/Services/DwfVersion.h" />
     <Header path="../../../../Common/MapGuideCommon/Services/FeatureInformation.h" />

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/PlatformBase/PlatformBaseApiGen.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -104,29 +104,6 @@
     <Header path="../../../../Common/PlatformBase/Data/SingleProperty.h" />
     <Header path="../../../../Common/PlatformBase/Data/StringPropertyCollection.h" />
 
-    <Header path="../../../../Common/PlatformBase/Exception/ArrayTypeMismatchException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/DuplicateResourceDataException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/DuplicateResourceException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/EmptyFeatureSetException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/FdoException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/FeatureServiceException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidMapDefinitionException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidRepositoryNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidRepositoryTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceDataNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceDataTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceNameException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourcePathException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourcePreProcessingTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/InvalidResourceTypeException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/LayerNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceBusyException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceDataNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ResourceNotFoundException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ServiceNotAvailableException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/ServiceNotSupportedException.h" />
-    <Header path="../../../../Common/PlatformBase/Exception/UserNotFoundException.h" />
-
     <Header path="../../../../Common/PlatformBase/Services/FeatureCommand.h" />
     <Header path="../../../../Common/PlatformBase/Services/FeatureQueryOptions.h" />
     <Header path="../../../../Common/PlatformBase/Services/FeatureSourceParams.h" />

Modified: sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/catchall.code
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/catchall.code	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/DotNetUnmanagedApi/catchall.code	2020-10-21 15:20:56 UTC (rev 9748)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowDotNetExceptionWrapper(e);
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpClearTileCache.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpClearTileCache.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpClearTileCache.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -62,7 +62,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpClearTileCache.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpClearTileCache.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -142,7 +142,7 @@
         version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpCreateRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateSession.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateSession.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCreateSession.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -61,7 +61,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"MgHttpCreateSession.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpCreateSession.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertCoordinateSystemCodeToWkt.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(wkt);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertEpsgCodeToWkt.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -60,7 +60,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(wkt);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToCoordinateSystemCode.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(code);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsConvertWktToEpsgCode.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(epsgCode);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsGetBaseLibrary.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -56,7 +56,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(library);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsIsValid.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsIsValid.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsIsValid.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -59,7 +59,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(bResult);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpCsTransformCoordinates.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -148,7 +148,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpCsTransformCoordinates.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -122,7 +122,7 @@
         version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpDescribeRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpEnumerateUnmanagedData.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -54,7 +54,7 @@
         arguments.Add(MgHttpResourceStrings::reqRecursive);
         arguments.Add(recursive);
 
-        throw new MgInvalidArgumentException(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBinaryOperation.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -73,7 +73,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoOperator);
         arguments.Add(m_operator);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBinaryOperation.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBinaryOperation.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
     }
 
@@ -123,7 +123,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBinaryOperation.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBoundary.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBoundary.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBoundary.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBoundary.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBoundary.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
         INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBoundary.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBuffer.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBuffer.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoBuffer.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -60,7 +60,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -70,7 +70,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoCoordinateSystem);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -80,7 +80,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoFormat);
         arguments.Add(m_format);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoBuffer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoBuffer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 
@@ -145,7 +145,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoBuffer.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoConvexHull.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoConvexHull.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoConvexHull.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoConvexHull.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoConvexHull.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoConvexHull.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoDistance.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoDistance.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoDistance.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -44,7 +44,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoDistance.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoDistance.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -54,7 +54,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometryOther);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoDistance.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoDistance.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -117,7 +117,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoDistance.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSimplify.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSimplify.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSimplify.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -59,7 +59,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSimplify.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSimplify.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -73,7 +73,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoAlgorithm);
         arguments.Add(arg);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSimplify.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSimplify.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 
@@ -127,7 +127,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoSimplify.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoSpatialPredicate.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -67,7 +67,7 @@
         arguments.Add(MgHttpResourceStrings::reqGeoOperator);
         arguments.Add(m_operator);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoSpatialPredicate.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoSpatialPredicate.Execute",
             __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
     }
 
@@ -85,7 +85,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoSpatialPredicate.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoTessellate.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoTessellate.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeoTessellate.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -57,7 +57,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeoTessellate.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeoTessellate.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -110,7 +110,7 @@
         INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeoTessellate.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeometryInfo.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeometryInfo.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGeometryInfo.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -42,7 +42,7 @@
         arguments.Add(MgHttpResourceStrings::reqFeatGeometry);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGeometryInfo.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGeometryInfo.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -153,7 +153,7 @@
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(4, 0, 0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
             L"MgHttpGeometryInfo.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeX.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -74,7 +74,7 @@
         value = new MgHttpPrimitiveValue(size);
     }
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetDefaultTileSizeX.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 
@@ -95,7 +95,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDefaultTileSizeX.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDefaultTileSizeY.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -74,7 +74,7 @@
         value = new MgHttpPrimitiveValue(size);
     }
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 
@@ -95,7 +95,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDefaultTileSizeY.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDrawingCoordinateSpace.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -64,7 +64,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(result);
     if (!value)
-        throw new MgOutOfMemoryException(L"MgHttpGetDrawingCoordinateSpace.Exceute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetDrawingCoordinateSpace.Exceute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDwfViewerPage.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -54,7 +54,7 @@
     ValidateCommonParameters();
 
     // Run API command
-    throw new MgNotImplementedException(L"MgHttpGetDwfViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHttpGetDwfViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetDwfViewerPage.Execute")
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -49,7 +49,7 @@
         arguments.Add(MgHttpResourceStrings::reqRenderingFormat);
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetDynamicMapOverlayImage.MgHttpGetDynamicMapOverlayImage",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetDynamicMapOverlayImage.MgHttpGetDynamicMapOverlayImage",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -137,7 +137,7 @@
         version != MG_API_VERSION(2,0,0) &&
         version != MG_API_VERSION(2,1,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetDynamicMapOverlayImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetHtmlViewerPage.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -54,7 +54,7 @@
     ValidateCommonParameters();
 
     // Run API command
-    throw new MgNotImplementedException(L"MgHttpGetHtmlViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgHttpGetHtmlViewerPage.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetHtmlViewerPage.Execute")
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetIdentityProperties.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetIdentityProperties.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -63,7 +63,7 @@
     // Throw on empty class name
     if (className.empty())
     {
-        throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // Create Proxy Feature Service instance
@@ -75,7 +75,7 @@
     Ptr<MgClassDefinitionCollection> idClasses = service->GetIdentityProperties(&resId, schema, classNames);
     if (idClasses.p == NULL || idClasses->GetCount() == 0)
     {
-        throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     Ptr<MgClassDefinition> idClass = idClasses->GetItem(0);
     Ptr<MgPropertyDefinitionCollection> identityProps = idClass->GetIdentityProperties();

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetLongTransactions.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetLongTransactions.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetLongTransactions.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -52,7 +52,7 @@
         arguments.Add(L"0");
         arguments.Add(activeOnly);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetLongTransactions.MgHttpGetLongTransactions",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetLongTransactions.MgHttpGetLongTransactions",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetMapImage.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetMapImage.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetMapImage.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -154,7 +154,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(3,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetMapImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetPlot.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetPlot.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetPlot.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -142,7 +142,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetPlot.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetPlot.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSessionTimeout.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSessionTimeout.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSessionTimeout.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -61,7 +61,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"MgHttpGetSessionTimeout.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpGetSessionTimeout.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSpatialContexts.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSpatialContexts.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetSpatialContexts.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -50,7 +50,7 @@
         arguments.Add(L"0");
         arguments.Add(activeOnly);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetSpatialContexts.MgHttpGetSpatialContexts",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetSpatialContexts.MgHttpGetSpatialContexts",
             __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileImage.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileImage.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileImage.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -92,7 +92,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpGetTileImage.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpGetTileImage.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -146,7 +146,7 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(1,2,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetTileImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileProviders.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileProviders.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpGetTileProviders.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -83,7 +83,7 @@
     if (version != MG_API_VERSION(3,0,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpGetTileProviders.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetFeatures.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetFeatures.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetFeatures.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -110,7 +110,7 @@
         arguments.Add(L"BBOX");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpKmlGetFeatures.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpKmlGetFeatures.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetLayer.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetLayer.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpKmlGetLayer.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -95,7 +95,7 @@
         arguments.Add(L"BBOX");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpKmlGetLayer.Execute",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpKmlGetLayer.Execute",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpPrimitiveValue.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpPrimitiveValue.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpPrimitiveValue.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -47,7 +47,7 @@
 MgHttpPrimitiveValue::MgHttpPrimitiveValue(CREFSTRING value)
 {
     if(!(m_value.pstr = new STRING(value)))
-        throw new MgOutOfMemoryException(L"MgHttpPrimitiveValue", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpPrimitiveValue", __LINE__, __WFILE__, NULL, L"", NULL);
     m_type = MgHttpPrimitiveValueTypes::HTTP_PRIMITIVE_TYPE_STRING;
 }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -128,7 +128,7 @@
             arguments.Add(L"0");
             arguments.Add(m_selectionVariant);
 
-            throw new MgInvalidArgumentException(L"MgHttpQueryMapFeatures.Execute",
+            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpQueryMapFeatures.Execute",
                 __LINE__, __WFILE__, &arguments, L"MgInvalidFeatureSpatialOperation", NULL);
         }
     }
@@ -181,7 +181,7 @@
         version != MG_API_VERSION(2,6,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpQueryMapFeatures.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequest.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequest.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequest.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -325,7 +325,7 @@
     //find in the map the creator for the http mapping class
     MgHttpRequestResponseHandler* (*createFunc)(MgHttpRequest*) = httpClassCreators[OperationName];
     if(createFunc == NULL)
-        throw new MgInvalidOperationException(L"MgHttpRequest::CreateRequestResponseHandler", __LINE__, __WFILE__, NULL, L"", NULL);
+        new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgHttpRequest::CreateRequestResponseHandler", __LINE__, __WFILE__, NULL, L"", NULL);
 
     //instantiate the http class
     returnHandler = (*createFunc)(this);

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -69,7 +69,7 @@
         config->GetBoolValue(MgConfigProperties::AgentPropertiesSection, disableProperty, bDisable, false);
         if (bDisable)
         {
-            throw new MgInvalidOperationException(L"HttpRequestResponseHandler.InitializeCommonParamters", __LINE__, __WFILE__, NULL, L"", NULL);
+            new MgException(MgExceptionCodes::MgInvalidOperationException, L"HttpRequestResponseHandler.InitializeCommonParamters", __LINE__, __WFILE__, NULL, L"", NULL);
         }
     }
 
@@ -198,7 +198,7 @@
     // will eat up one of the servers and give uneven load balancing.
     if (m_userInfo->GetUserName().empty() && m_userInfo->GetMgSessionId().empty())
     {
-        throw new MgAuthenticationFailedException(L"MgHttpRequestResponseHandler.InitializeCommonParameters", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgAuthenticationFailedException, L"MgHttpRequestResponseHandler.InitializeCommonParameters", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // And create the site connection
@@ -221,7 +221,7 @@
         arguments.Add(L"0");
         arguments.Add(MgResources::BlankArgument);
 
-        throw new MgInvalidArgumentException(L"MgHttpRequestResponseHandler.ValidateCommonParameters",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpRequestResponseHandler.ValidateCommonParameters",
             __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
     }
 
@@ -246,7 +246,7 @@
         version != MG_API_VERSION(2,2,0) &&
         version != MG_API_VERSION(4,0,0))
     {
-        throw new MgInvalidOperationVersionException(
+        throw new MgException(MgExceptionCodes::MgInvalidOperationVersionException, 
         L"MgHttpRequestResponseHandler.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpResourceExists.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpResourceExists.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpResourceExists.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -80,7 +80,7 @@
 
     if (NULL == value.p)
     {
-        throw new MgOutOfMemoryException(L"MgHttpResourceExists.Execute",
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgHttpResourceExists.Execute",
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpTestConnection.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpTestConnection.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpTestConnection.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -76,7 +76,7 @@
 
     Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(ret);
     if(!value)
-        throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"", __LINE__, __WFILE__, NULL, L"", NULL);
 
     hResult->SetResultObject(value, MgMimeType::Text);
 

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -385,7 +385,7 @@
                         {
                             MgStringCollection args;
                             args.Add(sFeatureType);
-                            throw new MgInvalidArgumentException(L"MgHttpWfsGetFeature.AcquireResponseData", __LINE__, __WFILE__, NULL, L"MgCannotResolveFeatureSourceFromWfsTypeName", &args);
+                            throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgHttpWfsGetFeature.AcquireResponseData", __LINE__, __WFILE__, NULL, L"MgCannotResolveFeatureSourceFromWfsTypeName", &args);
                         }
                     }
                     else //Feature type name is malformed. We expected the form <namespace>:<class_name>

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWmsGetMap.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWmsGetMap.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/HttpWmsGetMap.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -26,26 +26,25 @@
 
 // TODO: migrate these to a common Mg*.h header (not Ogc*.h) for use in other handlers.
 
+/////////////////////////////////////////////////////////////////////////////////////////
+//                                          The MgException* pointer var               //
+//                                          |           MgOgcWmsException::kpsz...     //
+//                                          |           |                  OgcServer&  //
+//                                          |           |                  |           //
+#define CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(exvar, ogc_exception_code,ogc_server) \
+    MgHttpUtil::LogException(exvar);                                              \
+    STRING sReport = exvar->GetExceptionMessage();                                \
+    sReport += _("<details>");                                                    \
+    sReport += exvar->GetDetails();                                               \
+    sReport += _("</details>");                                                   \
+    ogc_server.ServiceExceptionReportResponse(                                    \
+        MgOgcWmsException(MgOgcWmsException::ogc_exception_code,                  \
+                            sReport.c_str() ));                                   \
+    Ptr<MgByteReader> capabilities = responseStream.Stream().GetReader();         \
+    hResult->SetResultObject(capabilities, capabilities->GetMimeType());          \
+    SAFE_RELEASE(exvar);                                                          \
+
 ///////////////////////////////////////////////////////////////////////////////////////////////
-//                                          MgException* or derivative                       //
-//                                          |                 MgOgcWmsException::kpsz...     //
-//                                          |                 |                  OgcServer&  //
-//                                          |                 |                  |           //
-#define CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(mg_exception_type,ogc_exception_code,ogc_server)  \
-        catch (mg_exception_type* e) {                                                        \
-            MgHttpUtil::LogException(e);                                                      \
-            STRING sReport = e->GetExceptionMessage();                                        \
-            sReport += _("<details>");                                                        \
-            sReport += e->GetDetails();                                                       \
-            sReport += _("</details>");                                                       \
-            ogc_server.ServiceExceptionReportResponse(                                        \
-                MgOgcWmsException(MgOgcWmsException::ogc_exception_code,                      \
-                                  sReport.c_str() ));                                         \
-            Ptr<MgByteReader> capabilities = responseStream.Stream().GetReader();             \
-            hResult->SetResultObject(capabilities, capabilities->GetMimeType());              \
-            e->Release();                                                                     \
-        }                                                                                     \
-///////////////////////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 //                                                   MgOgcWmsException::kpsz...              //
@@ -53,7 +52,7 @@
 //                                                   |                  |                    //
 #define CATCH_ANYTHING_HANDLE_AS_OGC_WMS(methodName, ogc_exception_code,ogc_server)           \
         catch (...) {                                                                         \
-            Ptr<MgUnclassifiedException> mgException = new MgUnclassifiedException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+            Ptr<MgException> mgException = new MgException(MgExceptionCodes::MgUnclassifiedException, methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
             MgHttpUtil::LogException(mgException);                                            \
             ogc_server.ServiceExceptionReportResponse(                                        \
                 MgOgcWmsException(MgOgcWmsException::kpszInternalError,                       \
@@ -236,9 +235,21 @@
     //  Custom catch clauses.  In short, NO, we do NOT want to let MapGuide exceptions
     //  pass through.  The buck stops here, with an exception report that WE generate
     //  according to OGC specifications.
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgInvalidCoordinateSystemException,   kpszInvalidCRS,   wms)
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgCoordinateSystemLoadFailedException,kpszInvalidCRS,   wms)
-    CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(MgException,                          kpszInternalError,wms)
+    catch (MgException* ex)
+    {
+        if (ex->GetExceptionCode() == MgExceptionCodes::MgInvalidCoordinateSystemException)
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInvalidCRS, wms)
+        }
+        else if (ex->GetExceptionCode() == MgExceptionCodes::MgCoordinateSystemLoadFailedException)
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInvalidCRS, wms)
+        }
+        else
+        {
+            CATCH_MGEXCEPTION_HANDLE_AS_OGC_WMS(ex, kpszInternalError, wms)
+        }
+    }
     CATCH_ANYTHING_HANDLE_AS_OGC_WMS(L"MgHttpWmsGetMap.Execute",              kpszInternalError,wms)
 
     // Destroy the session now that we are done

Modified: sandbox/jng/flatten_exceptions/Web/src/HttpHandler/ReaderByteSourceImpl.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/HttpHandler/ReaderByteSourceImpl.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/HttpHandler/ReaderByteSourceImpl.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -367,5 +367,5 @@
 ///
 void MgReaderByteSourceImpl::Rewind()
 {
-    throw new MgInvalidOperationException(L"MgReaderByteSourceImpl.Rewind", __LINE__, __WFILE__, NULL, L"", NULL);
+    new MgException(MgExceptionCodes::MgInvalidOperationException, L"MgReaderByteSourceImpl.Rewind", __LINE__, __WFILE__, NULL, L"", NULL);
 }
\ No newline at end of file

Modified: sandbox/jng/flatten_exceptions/Web/src/IsapiAgent/IsapiPostParser.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/IsapiAgent/IsapiPostParser.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/IsapiAgent/IsapiPostParser.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -52,7 +52,7 @@
 
     if (dwTotalBytes < 0 || dwTotalBytes > MAXPOSTSIZE)
     {
-        throw new MgStreamIoException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (dwTotalBytes > 0)
@@ -75,7 +75,7 @@
 
             if (NULL == m_pBuffer)
             {
-                throw new MgOutOfMemoryException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             m_bufSize = dwTotalBytes;
@@ -193,7 +193,7 @@
     else
     {
         // Throw a better exception here?
-        throw new MgStreamIoException(L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgStreamIoException, L"IsapiPostParser.Parse", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     MG_CATCH_AND_THROW(L"IsapiPostParser.Parse");

Modified: sandbox/jng/flatten_exceptions/Web/src/JavaApi/catchall.code
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/JavaApi/catchall.code	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/JavaApi/catchall.code	2020-10-21 15:20:56 UTC (rev 9748)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowJavaExceptionWrapper(jenv, e);
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/JavaApiEx/catchall.code
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/JavaApiEx/catchall.code	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/JavaApiEx/catchall.code	2020-10-21 15:20:56 UTC (rev 9748)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowJavaExceptionWrapper(jenv, e);
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/Constants.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/Constants.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/Constants.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -130,6 +130,7 @@
   <Class name="MgUnitType" />
   <Class name="MgPackageStatus" />
   <Class name="MgRasterDataModelType" />
+  <Class name="MgExceptionCodes" />
 </Classes>
 
 <!--
@@ -143,6 +144,7 @@
     <Header path="../../../Common/Foundation/Data/FeaturePropertyType.h" />
     <Header path="../../../Common/Foundation/Data/MimeType.h" />
     <Header path="../../../Common/Foundation/Data/PropertyType.h" />
+    <Header path="../../../Common/Foundation/Exception/ExceptionCodes.h" />
 
     <Header path="../../../Common/PlatformBase/MapLayer/LayerGroupType.h" />
     <Header path="../../../Common/PlatformBase/MapLayer/LayerType.h" />

Modified: sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/MapGuideApiGen.xml
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/MapGuideApiGen.xml	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/MapGuideApi/MapGuideApiGen.xml	2020-10-21 15:20:56 UTC (rev 9748)
@@ -126,56 +126,7 @@
     <Header path="../../../Common/Foundation/Data/StringProperty.h" />
 
     <Header path="../../../Common/Foundation/Exception/Exception.h" />
-    <Header path="../../../Common/Foundation/Exception/SystemException.h" />
-    <Header path="../../../Common/Foundation/Exception/IoException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/StreamIoException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfRangeException.h" />
 
-    <Header path="../../../Common/Foundation/Exception/ApplicationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ArgumentOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/ClassNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ConfigurationSaveFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/DateTimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/DecryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/DirectoryNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/DivideByZeroException.h" />
-    <Header path="../../../Common/Foundation/Exception/DomainException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateDirectoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateFileException.h" />
-    <Header path="../../../Common/Foundation/Exception/DuplicateObjectException.h" />
-    <Header path="../../../Common/Foundation/Exception/EncryptionException.h" />
-    <Header path="../../../Common/Foundation/Exception/FileNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/IndexOutOfRangeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidCastException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidOperationException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidPropertyTypeException.h" />
-    <Header path="../../../Common/Foundation/Exception/InvalidStreamHeaderException.h" />
-    <Header path="../../../Common/Foundation/Exception/LengthException.h" />
-    <Header path="../../../Common/Foundation/Exception/LogicException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotFiniteNumberException.h" />
-    <Header path="../../../Common/Foundation/Exception/NotImplementedException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullArgumentException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullPropertyValueException.h" />
-    <Header path="../../../Common/Foundation/Exception/NullReferenceException.h" />
-    <Header path="../../../Common/Foundation/Exception/ObjectNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/OutOfMemoryException.h" />
-    <Header path="../../../Common/Foundation/Exception/OverflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/PlatformNotSupportedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourcesLoadFailedException.h" />
-    <Header path="../../../Common/Foundation/Exception/ResourceTagNotFoundException.h" />
-    <Header path="../../../Common/Foundation/Exception/RuntimeException.h" />
-    <Header path="../../../Common/Foundation/Exception/TemporaryFileNotAvailableException.h" />
-    <Header path="../../../Common/Foundation/Exception/ThirdPartyException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnclassifiedException.h" />
-    <Header path="../../../Common/Foundation/Exception/UnderflowException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlException.h" />
-    <Header path="../../../Common/Foundation/Exception/XmlParserException.h" />
-
     <!-- Geometry classes -->
 
     <Header path="../../../Common/Geometry/GeometricEntity.h" />
@@ -264,17 +215,6 @@
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemTransform.h" />
     <Header path="../../../Common/Geometry/CoordinateSystem/CoordinateSystemUnitInformation.h" />
 
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemComputationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemConversionFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemInitializationFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemLoadFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemMeasureFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/CoordinateSystemTransformFailedException.h" />
-    <Header path="../../../Common/Geometry/Exception/GeometryException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemTypeException.h" />
-    <Header path="../../../Common/Geometry/Exception/InvalidCoordinateSystemUnitsException.h" />
-
     <!-- PlatformBase classes -->
 
     <Header path="../../../Common/PlatformBase/Data/BlobProperty.h" />
@@ -292,29 +232,6 @@
     <Header path="../../../Common/PlatformBase/Data/SingleProperty.h" />
     <Header path="../../../Common/PlatformBase/Data/StringPropertyCollection.h" />
 
-    <Header path="../../../Common/PlatformBase/Exception/ArrayTypeMismatchException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceDataException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/DuplicateResourceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/EmptyFeatureSetException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FdoException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/FeatureServiceException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidMapDefinitionException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidRepositoryTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceDataTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceNameException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePathException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourcePreProcessingTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/InvalidResourceTypeException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/LayerNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceBusyException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceDataNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ResourceNotFoundException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotAvailableException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/ServiceNotSupportedException.h" />
-    <Header path="../../../Common/PlatformBase/Exception/UserNotFoundException.h" />
-
     <Header path="../../../Common/PlatformBase/Services/FeatureCommand.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureQueryOptions.h" />
     <Header path="../../../Common/PlatformBase/Services/FeatureSourceParams.h" />
@@ -368,56 +285,6 @@
 
     <!-- MapGuideCommon classes -->
 
-    <Header path="../../../Common/MapGuideCommon/Exception/AuthenticationFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ConnectionFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ConnectionNotOpenException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DbException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DbXmlException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateGroupException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateNameException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateParameterException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateRepositoryException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateRoleException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateServerException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateSessionException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DuplicateUserException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfSectionNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/DwfSectionResourceNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/EndOfStreamException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/GroupNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidDwfPackageException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidDwfSectionException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidFeatureSourceException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidIpAddressException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidLicenseException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidLogEntryException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPasswordException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutFontSizeUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutPositionUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidPrintLayoutSizeUnitsException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/InvalidServerNameException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/LicenseException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/LicenseExpiredException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/OperationProcessingException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ParameterNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PathTooLongException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PortNotAvailableException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/PrintToScaleModeNotSelectedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryCreationFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryNotOpenException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RepositoryOpenFailedException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/RoleNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ServerNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/ServerNotOnlineException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/SessionExpiredException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/SessionNotFoundException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnauthorizedAccessException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnknownTileProviderException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UnsupportedTileProviderException.h" />
-    <Header path="../../../Common/MapGuideCommon/Exception/UriFormatException.h" />
-
     <Header path="../../../Common/MapGuideCommon/Services/DrawingService.h" />
     <Header path="../../../Common/MapGuideCommon/Services/DwfVersion.h" />
     <Header path="../../../Common/MapGuideCommon/Services/FeatureInformation.h" />

Modified: sandbox/jng/flatten_exceptions/Web/src/PhpApi/catchall.code
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/PhpApi/catchall.code	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/PhpApi/catchall.code	2020-10-21 15:20:56 UTC (rev 9748)
@@ -3,6 +3,6 @@
 {
     string s = proxyfname;
     wstring fname = MgUtil::MultiByteToWideChar(s);
-    MgUnclassifiedException* e = new MgUnclassifiedException(fname, __LINE__, __WFILE__, NULL, L"", NULL);
+    MgException* e = new MgException(MgExceptionCodes::MgUnclassifiedException, fname, __LINE__, __WFILE__, nullptr, L"", nullptr);
     ThrowPHPExceptionWrapper(e TSRMLS_CC);
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebCommand.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebCommand.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebCommand.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -201,7 +201,7 @@
 //
 void MgWebCommand::Serialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgWebCommand.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgWebCommand.Serialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -209,7 +209,7 @@
 //
 void MgWebCommand::Deserialize(MgStream* stream)
 {
-    throw new MgNotImplementedException(L"MgWebCommand.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
+    throw new MgException(MgExceptionCodes::MgNotImplementedException, L"MgWebCommand.Deserialize", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebFlyoutWidget.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebFlyoutWidget.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebFlyoutWidget.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -81,7 +81,7 @@
     {
         m_subItems = new MgWebWidgetCollection();
         if (m_subItems == NULL)
-            throw new MgOutOfMemoryException(L"MgWebLayout.AddSubItems", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.AddSubItems", __LINE__, __WFILE__, NULL, L"", NULL);
     }
     m_subItems->Add(item);
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebInvokeUrlCommand.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebInvokeUrlCommand.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebInvokeUrlCommand.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -28,7 +28,7 @@
     m_layers = new MgStringCollection();
 
     if(m_params == NULL || m_layers == NULL)
-        throw new MgOutOfMemoryException(L"MgWebInvokeUrlCommand.MgWebInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebInvokeUrlCommand.MgWebInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebLayout.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebLayout.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebLayout.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -39,7 +39,7 @@
     m_informationPane = new MgWebInformationPane();
     m_contextMenu = new MgWebContextMenu();
     if (!m_commands || !m_toolBar || !m_statusBar || !m_taskPane || !m_informationPane || !m_contextMenu)
-        throw new MgOutOfMemoryException(L"MgWebLayout.MgWebLayout", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.MgWebLayout", __LINE__, __WFILE__, NULL, L"", NULL);
 
     // get the resource service to query the web layout definition
     Ptr<MgByteReader> xmlWebLayout = resourceService->GetResourceContent(webLayoutId);
@@ -374,7 +374,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseWebLayoutDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWebLayoutDefinition", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -418,7 +418,7 @@
 
             if (!valid)
             {
-                throw new MgXmlParserException(L"MgWebLayout.GetBooleanFromElement", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.GetBooleanFromElement", __LINE__, __WFILE__, NULL, L"", NULL);
             }
 
             return val;
@@ -580,11 +580,11 @@
     }
     else
     {
-        throw new MgXmlParserException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     if (cmd == NULL)
-        throw new MgOutOfMemoryException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 
     DOMNode* child = MgXmlUtil::GetFirstChild(elt);
     while (NULL != child)
@@ -629,7 +629,7 @@
 
     if (child == NULL)
     {
-        throw new MgXmlParserException(L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommand", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     // continue parsing for element specifics to the various type of commands
@@ -694,7 +694,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseBuiltInCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseBuiltInCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -746,7 +746,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -755,7 +755,7 @@
                 {
                     Ptr<MgStringProperty> prop = new MgStringProperty(key, value);
                     if (prop == NULL)
-                        throw new MgOutOfMemoryException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                     params->Add(prop);
                 }
             }
@@ -777,7 +777,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -793,7 +793,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeUrlCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -872,7 +872,7 @@
                                     }
                                     else
                                     {
-                                        throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                                     }
                                 }
                                 lchild1 = MgXmlUtil::GetNextSibling(lchild1);
@@ -881,17 +881,17 @@
                             {
                                 Ptr<MgStringProperty> prop = new MgStringProperty(property, displayName);
                                 if (prop == NULL)
-                                    throw new MgOutOfMemoryException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                    throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                                 resultColumns->Add(prop);
                             }
                             else
                             {
-                                throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                             }
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -899,7 +899,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -939,7 +939,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseInvokeScriptCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInvokeScriptCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -982,7 +982,7 @@
                         }
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     lchild = MgXmlUtil::GetNextSibling(lchild);
@@ -990,7 +990,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParsePrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1030,7 +1030,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseHelpCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseHelpCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1066,7 +1066,7 @@
             }
             else
             {
-               throw new MgXmlParserException(L"MgWebLayout.ParseUiTargetCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+               throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseUiTargetCommand", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1096,7 +1096,7 @@
         arguments.Add(L"1");
         arguments.Add(tt);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateTargetViewerType",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateTargetViewerType",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebTargetViewerType", NULL);
     }
 
@@ -1175,7 +1175,7 @@
         arguments.Add(L"1");
         arguments.Add(action);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateAction",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateAction",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebAction", NULL);
     }
 
@@ -1204,7 +1204,7 @@
         arguments.Add(L"1");
         arguments.Add(tt);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateTargetType",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateTargetType",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebTargetType", NULL);
     }
 
@@ -1261,7 +1261,7 @@
                             m_scale = GetDoubleFromElement(eltInner);
                         else
                         {
-                            throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
                         }
                     }
                     ichild = MgXmlUtil::GetNextSibling(ichild);
@@ -1273,7 +1273,7 @@
                 }
                 else if (centerXDefined != centerYDefined)
                 {
-                    throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                    throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
                 }
             }
             else if (strName == L"HyperlinkTarget") // NOXLATE
@@ -1286,7 +1286,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseMapProperties", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1330,7 +1330,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseInformationPane", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseInformationPane", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1362,7 +1362,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseStatusBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseStatusBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1400,7 +1400,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1435,24 +1435,24 @@
                 {
                     case MgWebWidgetType::Separator:
                         if ((widget = new MgWebSeparatorWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         break;
 
                     case MgWebWidgetType::Command:
                         if ((widget = new MgWebCommandWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         ParseCommandWidget(MgXmlUtil::GetNextSibling(child), (MgWebCommandWidget*)widget.p);
                         break;
 
                     case MgWebWidgetType::Flyout:
                         if ((widget = new MgWebFlyoutWidget()) == NULL)
-                            throw new MgOutOfMemoryException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                         ParseFlyoutWidget(MgXmlUtil::GetNextSibling(child), (MgWebFlyoutWidget*)widget.p);
                         break;
 
                     default:
                     {
-                        throw new MgXmlParserException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                        throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
                     }
                 }
                 break;
@@ -1459,7 +1459,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1495,7 +1495,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseCommandWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommandWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1548,7 +1548,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseFlyoutWidget", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseFlyoutWidget", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         node = MgXmlUtil::GetNextSibling(node);
@@ -1577,7 +1577,7 @@
         arguments.Add(L"1");
         arguments.Add(function);
 
-        throw new MgInvalidArgumentException(L"MgWebLayout.ValidateUiItemFunction",
+        throw new MgException(MgExceptionCodes::MgInvalidArgumentException, L"MgWebLayout.ValidateUiItemFunction",
             __LINE__, __WFILE__, &arguments, L"MgInvalidWebWidgetType", NULL);
     }
 
@@ -1614,7 +1614,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseContextMenu", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseContextMenu", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1658,7 +1658,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1719,7 +1719,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1765,7 +1765,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseTaskBarButton", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseTaskBarButton", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         ichild = MgXmlUtil::GetNextSibling(ichild);
@@ -1796,7 +1796,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseCommandSet", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseCommandSet", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);
@@ -1828,7 +1828,7 @@
             }
             else
             {
-                throw new MgXmlParserException(L"MgWebLayout.ParseZoomControl", __LINE__, __WFILE__, NULL, L"", NULL);
+                throw new MgException(MgExceptionCodes::MgXmlParserException, L"MgWebLayout.ParseZoomControl", __LINE__, __WFILE__, NULL, L"", NULL);
             }
         }
         child = MgXmlUtil::GetNextSibling(child);

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebPrintCommand.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebPrintCommand.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebPrintCommand.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -25,7 +25,7 @@
     m_action = MgWebActions::PrintMap;
     m_printLayouts = new MgStringCollection();
     if(m_printLayouts == NULL)
-        throw new MgOutOfMemoryException(L"MgWebPrintCommand.MgWebPrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebPrintCommand.MgWebPrintCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebSearchCommand.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebSearchCommand.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebSearchCommand.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -26,7 +26,7 @@
     m_action = MgWebActions::Search;
     m_resultColumns = new MgPropertyCollection();
     if(m_resultColumns == NULL)
-        throw new MgOutOfMemoryException(L"MgWebSearchCommand.MgWebSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebSearchCommand.MgWebSearchCommand", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskBar.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskBar.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskBar.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -23,13 +23,13 @@
 MgWebTaskBar::MgWebTaskBar()
 {
     if (!(m_taskList = new MgWebWidgetCollection()) || !(m_taskButtons = new MgWebWidgetCollection()))
-        throw new MgOutOfMemoryException(L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
 
     for (int i=0; i<4; ++i)
     {
         Ptr<MgWebTaskBarWidget> btn = new MgWebTaskBarWidget();
         if (btn == NULL)
-            throw new MgOutOfMemoryException(L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
+            throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskBar.MgWebTaskBar", __LINE__, __WFILE__, NULL, L"", NULL);
         m_taskButtons->Add(btn);
     }
 }

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskPane.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskPane.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebTaskPane.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -23,7 +23,7 @@
 MgWebTaskPane::MgWebTaskPane()
 {
     if (!(m_taskBar = new MgWebTaskBar()))
-        throw new MgOutOfMemoryException(L"MgWebTaskPane.MgWebTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebTaskPane.MgWebTaskPane", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebApp/WebToolbar.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebApp/WebToolbar.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebApp/WebToolbar.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -23,7 +23,7 @@
 MgWebToolBar::MgWebToolBar()
 {
     if (!(m_widgets = new MgWebWidgetCollection()))
-        throw new MgOutOfMemoryException(L"MgWebToolBar.MgWebToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
+        throw new MgException(MgExceptionCodes::MgOutOfMemoryException, L"MgWebToolBar.MgWebToolBar", __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
 ///////////////////////////////////////////////////////////////////////////

Modified: sandbox/jng/flatten_exceptions/Web/src/WebSupport/InitializeWebTier.cpp
===================================================================
--- sandbox/jng/flatten_exceptions/Web/src/WebSupport/InitializeWebTier.cpp	2020-10-21 14:38:32 UTC (rev 9747)
+++ sandbox/jng/flatten_exceptions/Web/src/WebSupport/InitializeWebTier.cpp	2020-10-21 15:20:56 UTC (rev 9748)
@@ -82,7 +82,7 @@
     //Check catalog
     if (NULL == csCatalog.p)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgInitializeWebTierInternal", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
@@ -102,7 +102,7 @@
     LibraryStatus status = csCatalog->GetLibraryStatus();
     if(lsInitialized != status)
     {
-        throw new MgCoordinateSystemInitializationFailedException(
+        new MgException(MgExceptionCodes::MgCoordinateSystemInitializationFailedException, 
             L"MgInitializeWebTierInternal", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 



More information about the mapguide-commits mailing list