Manage Exception Conditions
Exception Group classes manage exception conditions. Connect:Direct® generates Exception Group classes if an exception condition is encountered while a request is being processed. Following is an exception scenario where a message is pushed into the exception before the initial throw.
Function A calls Function B, and Function B calls Function C. Function C is a helper routine called by many routines so it does not include information specific to a task. Since the exception occurred in C, it throws the exception. A message describing the error is added and flagged as a technical message.
Function B traps the exception. A message describing the error is added and flagged as a user message. User messages are displayed in dialog boxes. For example, a user message reads: Communication with the server has been lost.
The CDMsgException class stores the messages as an array of strings. The messages are stored in a last-in first-out (LIFO) order because messages added later are more general as the exception moves up the call stack.
Following is a description of the Exception Group classes:
Class | Description |
---|---|
CDMsgException | The base exception class for all Connect:Direct exception objects. It provides a message stack for troubleshooting. |
CDConnectionException | This exception is generated when communication with the node is lost or cannot be established. |
CDCommandException | Generated when an object cannot be executed because parameters are invalid, including a submitted Process containing errors. |
CDLogonException | Generated if the Connect:Direct node rejects the user ID and password supplied in the logon attempt. You can respond to this exception by prompting the user for the correct logon information. |