[mapguide-commits] r4320 - trunk/MgDev/Common/PlatformBase/Exception

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 26 04:35:26 EDT 2009


Author: leaf
Date: 2009-10-26 04:35:26 -0400 (Mon, 26 Oct 2009)
New Revision: 4320

Modified:
   trunk/MgDev/Common/PlatformBase/Exception/FdoException.cpp
   trunk/MgDev/Common/PlatformBase/Exception/FdoException.h
Log:
Ticket 1127: Currently, when an MgFdoExeption is thrown, the client can catch it but is not able to get the error code. That is because the member variable MgFdoException::m_nativeErrorCode is not serialized. 
This submission adds serializing code for m_nativeErrorCode.

Modified: trunk/MgDev/Common/PlatformBase/Exception/FdoException.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Exception/FdoException.cpp	2009-10-26 04:53:16 UTC (rev 4319)
+++ trunk/MgDev/Common/PlatformBase/Exception/FdoException.cpp	2009-10-26 08:35:26 UTC (rev 4320)
@@ -62,3 +62,24 @@
 {
     return m_nativeErrorCode;
 }
+
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Serialize data to TCP/IP stream.
+///
+void MgFdoException::Serialize(MgStream* stream) throw()
+{
+    MgThirdPartyException::Serialize(stream);
+    stream->WriteInt64(m_nativeErrorCode);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Deserialize data from TCP/IP stream.
+///
+void MgFdoException::Deserialize(MgStream* stream) throw()
+{
+    MgThirdPartyException::Deserialize(stream);
+    stream->GetInt64(m_nativeErrorCode);
+}

Modified: trunk/MgDev/Common/PlatformBase/Exception/FdoException.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Exception/FdoException.h	2009-10-26 04:53:16 UTC (rev 4319)
+++ trunk/MgDev/Common/PlatformBase/Exception/FdoException.h	2009-10-26 08:35:26 UTC (rev 4320)
@@ -91,7 +91,25 @@
     virtual ~MgFdoException() throw();
 
 INTERNAL_API:
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Serialize data to TCP/IP stream.
+    ///
+    /// \param stream
+    /// Stream
+    ///
+    virtual void Serialize(MgStream* stream) throw();
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Deserialize data from TCP/IP stream.
+    ///
+    /// \param stream
+    /// Stream
+    ///
+    virtual void Deserialize(MgStream* stream) throw();
+
+
     DECLARE_EXCEPTION_DEFAULTS(MgFdoException)
 
 CLASS_ID:



More information about the mapguide-commits mailing list