| |
- ClientErrorComponent
class ClientErrorComponent |
|
This class demonstrates error handling when accessing a (remote)
component.
When the class is instantiated, it gets a reference to the
ErrorComponent counterpart throw the manager services provided
by the SimpleClient.
When the destructor is called, the reference to the component is released.
This strategy ensures a clean handling of references to Components.
Each of the public methods of the class demonstrates some error handling pattern.
Each method is self-contained and it should never throw exceptions in itself,
but for ACSErrTypeCommon::CouldntAccessComponentEx, to be used when the
reference to the component is not properly initialised.
Other errors are always completely handled internally. |
|
Methods defined here:
- TestOk(self)
- Here everything should go fine.
Parameters: None
Returns: None
Raises: ACSErrTypeCommonImpl.CouldntAccessComponentExImpl
- TestReceiveRemoteCompletion(self)
- Example 2: Calls a method that returns a completion
If the completion contains an error, then:
Catches the exception,
prints it locally
sends it to the logging system
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CouldntAccessComponentExImpl
- TestReceiveRemoteException(self)
- Example 1: Calls a method that throws an exception
with a stack trace:
Catches the exception,
Adds context information
Sends it to the logging system
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CouldntAccessComponentExImpl
- __del__(self)
- Destructor. Releases ErrorComponent
- __init__(self, client, error_comp)
- Constructor
Parameters: client is a simple client reference
errorComponent is the name of the ErrorComponent
- testCORBASystemException(self)
- Calls CORBASystemException, with differents depths,
catches the exceptions(if any, there shouldn't be if depth<=0)
- testCompletionFromCompletion(self)
- Calls completionFromCompletion, with differents depths,
catches the exceptions(if any, there shouldn't be if depth<=0)
- testCompletionOnStack(self)
- #no point doing this in python
- testExceptionFromCompletion(self)
- Calls exceptionFromCompletion, with differents depths,
catches the exceptions(if any, there shouldn't be if depth<=0)
- testOutCompletion(self)
- Calls outCompletion
- testTypeException(self)
- Calls typeException, with differents depths,
catches the exceptions(if any, there shouldn't be if depth<=0)
| |