Cape User Exception Class
Definition
Assembly: CapeOpen (in CapeOpen.dll) Version: 1.0.0.0 (1.0.0.0)
[SerializableAttribute]
[ClassInterfaceAttribute(ClassInterfaceType.None)]
[ComVisibleAttribute(true)]
[GuidAttribute("28686562-77AD-448f-8A41-8CF9C3264A3E")]
public abstract class CapeUserException : ApplicationException,
ECapeRoot, ECapeUser<SerializableAttribute>
<ClassInterfaceAttribute(ClassInterfaceType.None)>
<ComVisibleAttribute(true)>
<GuidAttribute("28686562-77AD-448f-8A41-8CF9C3264A3E")>
Public MustInherit Class CapeUserException
Inherits ApplicationException
Implements ECapeRoot, ECapeUser- Inheritance
- Object Exception ApplicationException CapeUserException
- Derived
Remarks
One of the principal advantages of .NET over COM is the additional information included in exception handling. In COM, exceptions were handled through returning an HRESULT value, which is an integer that indicated whether the function call had successfully returned (Rogerson, 1997). Because the HRESULT value was a 32-bit integer, it could indicate more information than simply success or failure, but it was limited in that it did not include descriptive information about the exception that occurred.
Under .NET, an application exception class is available (System.ApplicationException) that can be used to provide information such as a message and the source of the exception. The CAPE-OPEN exception definitions all derive from an ECapeRoot interface (Belaud et al, 2001). In the current implementation of the CAPE-OPEN exception classes, all exception classes derive from the CapeUserException class, which itself is derived from the .NET System.ApplicationException class. The CapeUserException class exposes the and interfaces. In this way, all exceptions that are raised by the process modeling components can be caught either as a CapeRootException or as a System.ApplicationException in addition to being caught as the derived exception type.
Constructors
| CapeUserException | Initializes a new instance of the CapeUserException class. |
| CapeUserException(String) | Initializes a new instance of the CapeUserException class with a specified error message. |
| CapeUserException(SerializationInfo, StreamingContext) | Initializes a new instance of the CapeUserException class with serialized data. |
| CapeUserException(String, Exception) | Initializes a new instance of the CapeUserException class with a specified error message and a erence to the inner exception that is the cause of this exception. |
Properties
| code | Code to designate the subcategory of the error. |
| description | The description of the error. |
| interfaceName | The name of the interface where the error is thrown. This is a mandatory field." |
| moreInfo | An URL to a page, document, web site, where more information on the error can be found. The content of this information is obviously implementation dependent. |
| Name | The name of the exception being thrown. |
| operation | The name of the operation where the error is thrown. This is a mandatory field. |
| scope | The scope of the error. |
Methods
| Initialize | A virtual abstract function that is inherieted by derived classes to initializes the description, interface name and name fields of this exception. |
| RegisterFunction | The function that controls COM registration. |
| UnregisterFunction | This function controls the removal of the class from the COM registry when the class is unistalled. |
Fields
| m_description | The description of the exception being thrown. |
| m_interfaceName | The name of the exception interface for the exception being thrown. |
| m_name | The name of the exception being thrown. |
Extension Methods
| GetEnumNames | (Defined by General) |
| IsValidDouble | (Defined by General) |