[mapguide-commits] r9777 - in sandbox/jng/vanilla_swig/Common: Foundation/System MapGuideCommon/Resources

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Nov 13 00:40:14 PST 2020


Author: jng
Date: 2020-11-13 00:40:13 -0800 (Fri, 13 Nov 2020)
New Revision: 9777

Modified:
   sandbox/jng/vanilla_swig/Common/Foundation/System/ClassFactory.cpp
   sandbox/jng/vanilla_swig/Common/MapGuideCommon/Resources/mapguide_en.res
Log:
We can do better than "class not found". Identify the class id that we can't find a class factory for and include it in the exception.

Modified: sandbox/jng/vanilla_swig/Common/Foundation/System/ClassFactory.cpp
===================================================================
--- sandbox/jng/vanilla_swig/Common/Foundation/System/ClassFactory.cpp	2020-11-13 07:49:13 UTC (rev 9776)
+++ sandbox/jng/vanilla_swig/Common/Foundation/System/ClassFactory.cpp	2020-11-13 08:40:13 UTC (rev 9777)
@@ -57,7 +57,11 @@
     ClassCreatorFunc func = m_classCreators[classId];
     if (NULL == func)
     {
-        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgClassFactory.CreateMgObject", __LINE__, __WFILE__, NULL, L"", NULL);
+        MgStringCollection args;
+        STRING sClassId;
+        MgUtil::Int32ToString(classId, sClassId);
+        args.Add(sClassId);
+        throw new MgException(MgExceptionCodes::MgClassNotFoundException, L"MgClassFactory.CreateMgObject", __LINE__, __WFILE__, NULL, L"MgNoClassFactoryForId", &args);
     }
 
     MgObject* obj = (*func)();

Modified: sandbox/jng/vanilla_swig/Common/MapGuideCommon/Resources/mapguide_en.res
===================================================================
--- sandbox/jng/vanilla_swig/Common/MapGuideCommon/Resources/mapguide_en.res	2020-11-13 07:49:13 UTC (rev 9776)
+++ sandbox/jng/vanilla_swig/Common/MapGuideCommon/Resources/mapguide_en.res	2020-11-13 08:40:13 UTC (rev 9777)
@@ -309,6 +309,7 @@
 MgMissingSchema                                       = No schema specified.
 MgMissingSrs                                          = No coordinate system specified.
 MgNameNotFound                                        = The name was not found.
+MgNoClassFactoryForId                                 = No registered class factory was found for class id: %1
 MgNoDataFromRenderer                                  = No data from renderer.
 MgNoNameForObject                                     = No object found for name (%1)
 MgNullArgument                                        = Null argument: %1



More information about the mapguide-commits mailing list