14.21 Exception Member Functions

The Oracle Tuxedo software supports the throwing and catching of exceptions.

Caution: Use of the wrong exception constructor causes non initialization of a data member. Exceptions that are defined to have a reason field need to be created using the constructor that initializes that data member. If the default constructor is used instead, that data member is not initialized and, during destruction of the exception, the system may attempt to destroy nonexistent data. When creating exceptions, be sure to use the constructor function that most fully initializes the data fields. These exceptions can be most easily identified by looking at the OMG IDL definition; they have additional data member definitions.

Descriptions of exception member functions follow:

CORBA::SystemException::SystemException ()
This is the default constructor for the CORBA::SystemException class. Minor code is initialized to 0 (zero) and the completion status is set to COMPLETED_NO.
CORBA::SystemException::SystemException ( const CORBA::SystemException & Se)
This is the copy constructor for the CORBA::SystemException class.
CORBA::SystemException::SystemException( CORBA::ULong Minor, CORBA::CompletionStatus Status)
This constructor for the CORBA::SystemException class sets the minor code and completion status.
Explanations of the arguments are as follows:
Minor
The minor code for the Exception object. The minor field is an implementation-specific value used by the ORB to identify the exception. The Oracle Tuxedo minor field definitions can be found in the file orbminor.h.
Status
The completion status for the Exception object. The values are as follows:
CORBA::COMPLETED_YES
CORBA::COMPLETED_NO
CORBA::COMPLETED_MAYBE
CORBA::SystemException::~SystemException ()
This is the destructor for the CORBA::SystemException class. It frees any memory used for the Exception object.
CORBA::SystemException CORBA::SystemException::operator = const CORBA::SystemException Se)
This assignment operator copies exception information from the source exception. The Se argument specifies the SystemException object that is to be copied by this operator.
CORBA::CompletionStatus CORBA::SystemException::completed()
This member function returns the completion status for this exception.
CORBA::SystemException::completed( CORBA::CompletionStatus Completed)
This member function sets the completion status for this exception. The Completed argument specifies the completion status for this exception.
CORBA::ULong CORBA::SystemException::minor()
This member function returns the minor code for this exception.
CORBA::SystemException::minor (CORBA::ULong Minor)
This member function sets the minor code for this exception. The minor argument specifies the new minor code for this exception. The minor field is an implementation-specific value used by the application to identify the exception.
CORBA::SystemException * CORBA::SystemException::_narrow ( CORBA::Exception_ptr Exc)
This member function determines whether a specified exception can be narrowed to a system exception. The Exc argument specifies the exception to be narrowed.
If the specified exception is a system exception, this member function returns a pointer to the system exception. If the specified exception is not a system exception, the function returns 0 (zero).
CORBA::UserException * CORBA::UserException::_narrow( CORBA::Exception_ptr Exc)
This member function determines whether a specified exception can be narrowed to a user exception. The Exc argument specifies the exception to be narrowed.
If the specified exception is a user exception, this member function returns a pointer to the user exception. If the specified exception is not a user exception, the function returns 0 (zero).