An exception is any user, logic, or system error detected by a function that does not deal with the error itself but passes the error on to a handling routine, called an exception handler. In VisualAge, you can catch exceptions by connecting exception events to either actions or member functions.
An exception event is a feature of a connection, not a part. It appears as exceptionOccurred on the connection's connection menu. Exception events are typically connected to IMessageBox* parts, which are used to display error messages associated with the exceptions.
The return type of a target action displays as the actionResult event of the connection. You can connect the actionResult event to a feature of the same part or another part.
To connect an exception event, do the following:
throw IException("Error message.");
where the text of the error message that you want to display in the message box is the only parameter given for the IException constructor.
This connection causes the application to show a message box that contains the exception error message whenever the exception is thrown.
Connections
Connecting Features to Other Features
Connecting Features to Member
Functions
Connecting Features to Custom
Logic
Opening Connection Settings
Selecting and Deselecting
Connections
