Main Page Class Hierarchy Compound List Compound Members SoamException Class Reference
Base class of exceptions generated by the system, accessible to both client applications and services. More...
Inheritance diagram for SoamException:
List of all members.
Public Methods
SoamException (void) throw () Creates an exception with no error message. virtual const char * what () const throw () Return the error message. virtual SOAM_HRESULT getHR () const throw () Return the error code. virtual int getErrorCode (void) const throw () Returns the system error code for this exception. virtual const char * getErrorType (void) const throw () Indicates the type of the exception. This will return the type by name for example "FailureException". SoamException * getEmbeddedException (void) const throw () Returns a pointer to the embedded exception object. SoamException & operator= (const SoamException &rhs) The assignment operator. Friends
class ServiceContainer class Message Detailed Description
Base class of exceptions generated by the system, accessible to both client applications and services.Some exceptions are generated by the system itself, while others are generated by the service and propagated back to the client application.
If a pointer to a
SoamException
object is thrown within the service, the memory it is pointing to will be freed automatically using the delete operator.
If your exception must be created on the heap then it is recommended that a smart pointer be thrown instead of a raw pointer to prevent any ambiguity.
eg.
SoamExceptionPtr ex = new SoamException();
...
throw ex;
NOTE :
- It is always recomended that you throw either a FailureException or FatalException so that you can preserve the context of the exception for inspection by the client.
- If you create an object of this type on the heap (e.g. using the
new
operator), it is always best to assign it to the appropriate smart pointer type, and access it from there instead of using the raw pointer. If you use the suggested way and access the object through a smart pointer, you should never explicitly delete the object, since the smart pointer will automatically cleanup the object for you.- If any of the methods of this class are called after the main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).
- See also:
- SoamExceptionPtr
Constructor & Destructor Documentation
SoamException ( void ) throw ()
Creates an exception with no error message.
Member Function Documentation
virtual const char* what ( ) const throw () [virtual]
Return the error message.
- Returns:
- a string containing the error message.
virtual SOAM_HRESULT getHR ( ) const throw () [virtual]
Return the error code.
- Returns:
- the error code.
virtual int getErrorCode ( void ) const throw () [virtual]
Returns the system error code for this exception.
virtual const char* getErrorType ( void ) const throw () [virtual]
Indicates the type of the exception. This will return the type by name for example "FailureException".
SoamException* getEmbeddedException ( void ) const throw ()
Returns a pointer to the embedded exception object.
When an exception is thrown from the service, the middleware will embed the service exception within a SoamException to provide context.
This method will retrieve the embedded exception thrown in the service. If no exception is embedded it will return 0 (i.e. NULL).
The caller of this method will own the embedded exception and must delete it after use. For simplicity, it is recommended that you retrieve the embedded exception using a smart pointer so that you do not need to worry about cleaning up the embedded exception object.
SoamExceptionPtr embeddedEx = ex.getEmbeddedException();
- Returns:
- a pointer to an embedded exception object, if present.
- Exceptions:
SoamException
SoamException& operator= ( const SoamException & rhs )
The assignment operator.
This method will safely assign the exception being passed to the current exception.
- Returns:
- a reference to the current object.
Date Modified: 28 Apr 2011
Platform Support: support@platform.com
Platform Information Development: doc@platform.com
Platform Computing. Accelerating Intelligence(TM).
Copyright © 2001-2009 Platform Computing Corporation. All rights reserved.