Collection of classes used for error handling and return codes.
- There (at least) two different types of function prototypes.
- One that returns a FunctionResult and one that returns an instance of a DCA object.
- Functions that return a FunctionResult do not throw an exception.
FunctionResult fr = function1();
The FunctionResult::operator bool() can be used to determine whether an error has occured.
- Functions that return an instance to a DCA object throw an exception on error.
AnyInstance = function2();
The details of the error can be examined by using the ExDca::getReturnCode() function
- Use a dca::ExDca try-catch handler for all methods that do not return a FunctionResult.
Ensure that you have defined (at least) an dca::ExDca catch handler at the highest level of your application.
- See also
- DCA Generic Error Codes
Error Handling Sample
{
try {
if( !myFR ) {
cout <<
"DCA error return code received; Error code: " << myFR.
getReturnCode()
}
}
<< ". Aborting" << endl;
}
}