wiki:MapGuideRfc79

Version 2 (modified by Aleck, 15 years ago) ( diff )

--

This page describes the format to be used when developing RFCs for proposal to the mapguide-internals mail list and subsequent presentation to the MapGuide PSC. New RFCs should be created following the instructions at the top of the RFCs page.

The original version of this document was based on the RFCs from http://mapserver.gis.umn.edu/development/rfc.

RFC Template Version: 1.0 Last Modified: 04:50, 3 November 2006 (CET) (Jason Birch)


MapGuide RFC # - Title Goes Here

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission DateJuly 17th, 2009
Last ModifiedAleck Sun Timestamp
AuthorAleck Sun
RFC Statusdraft
Implementation Statuspending
Proposed Milestone2.2
Assigned PSC guide(s)Tom Fukushima
Voting History(vote date)
+1
+0
-0
-1
no vote

Overview

This proposal is to provide more specific exceptions and more information for the underlying FDO errors by exposing native error code of FDO provider.

Motivation

As per FDO RFC37 FdoException is going to provide a GetNativeErrorCode method, MgFdoException should also provide such a method, so that users can get the native error code of FDO exception directly, and then do some specific process regarding the native error code . Also, in GIS Platform API, the MgApplicationException does not have enough subclasses to indicate the actual error. Hence more specific exception classes will be added into GIS Platform.

Proposed Solution

The following methods will be added to class MgFdoException to return native error code. Code that creates an MgFdoException should be updated to assign it a native error code it possible

class MG_PLATFORMBASE_API MgFdoException : public MgThirdPartyException
{
    DECLARE_CLASSNAME(MgFdoException)
PUBLISHED_API:
    ////////////////////////////////////////////////////////////////////
    /// \brief
    /// Retrieve the native error code of the underlying FDO exception.
    ///
    /// \return
    /// native error code of an fdo exception
    ///
    INT64 GetNativeErrorCode();

EXTERNAL_API:
////////////////////////////////////////////////////////////////////
    /// \brief
    /// Construct a MgFdoException object.
    ///
    /// \param methodName
    /// Name of the method where the exception occurred.
    /// \param lineNumber
    /// Line number where the exception occurred.
    /// \param fileName
    /// File name where the exception occurred.
    /// \param whatArguments
    /// Collection of arguments used to format the message that describes what the exception is.
    /// \param whyMessageId
    /// ID of the message that describes why the exception occurs.
    /// \param whyArguments
    /// Collection of arguments used to format the message that describes why the exception occurs.
    ///
    MgFdoException(CREFSTRING methodName, INT32 lineNumber,
        CREFSTRING fileName, MgStringCollection* whatArguments,
        CREFSTRING whyMessageId, MgStringCollection* whyArguments,
        INT64 nativeErrorCode) throw();
}; 

The following exception classes will be added into GIS Platform API. In the following class diagram, ones with white color are the existing classes and ones with light green color are the new ones. There are no any new methods added to those new exception classes. All of methods are inherited from MgException. The description of new exception classes above are as follows.

The description of new exception classes above are as follows.
MgNotConnectedException: Thrown when executing an operation that require feature source connection is connected.
MgWrongConnectionParamValueException: Thrown when connecting datastore with invalid connection parameters.
MgInsufficentPrivilegesException: Thrown when connecting a FDO data source without sufficient privileges.
!MgInvalidSQLStatementException: Thrown when executing an invalid SQL statement.
MgOutOfRangePropertyValueException: Thrown when setting the property value to one which violates constraint FdoPropertyValueConstraintRange.
MgNotUniquePropertyValueException: Thrown when setting the property value to one which isn’t unique.
MgNotInListPropertyValueException: Thrown when setting the property value to one which violates constraint FdoPropertyValueConstraintList.
MgSchemaDoesNotExistException: Thrown when the specified schema doesn’t exist.
MgSchemaAlreadyExistsException: Thrown when creating a schema that already exists.
MgClassDoesNotExistException: Thrown when the specified class doesn’t exist.
MgClassAlreadyExistsException: Thrown when creating a class that already exists.
MgPropertyDoesNotExistException: Thrown when the specified class doesn’t exist.
MgPropertyAlreadyExistsException: Thrown when creating a class that already exists.

Implications

The server should be updated to throw the newly added detailed exceptions if possible.

Test Plan

Run the existing unit tests.

Funding/Resources

Autodesk to provide resources / funding

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.