Specifications

Error Handling
3-5
3
If you specify IPL_ErrModeParent, errors are processed in the “parents”
of the function call tree. When
iplError() is called as the result of
detecting an error, an error message will print, but the program will not
terminate. Each time a function calls another function, it must check to see
if an error has occurred. When an error occurs, the function should call
iplError() specifying IPL_StsBackTrace, and then return. The macro
IPL_ERRCHK() may be used to perform both the error check and back-trace
call. This passes the error “up” the function call tree until eventually some
parent function (possibly
main()) detects the error and terminates the
program.
IPL_ErrModeSilent is similar to IPL_ErrModeParent,exceptthaterror
messages are not printed.
IPL_ErrModeLeaf is the default, and is the simplest method of processing
errors.
IPL_ErrModeParent requires more programming effort, but
provides more detailed information about where and why an error
occurred. All of the functions in the library support both options (that is,
they use
IPL_ERRCHK() after function calls). If an application uses the
IPL_ErrModeParent option, it is essential that it checks for errors after all
library functions that it calls.
The status code of the last detected error is stored into the variable
IplLastStatus and can be returned by calling iplGetErrStatus().The
value of this variable may be used by the application during the back-trace
process to determine what type of error initiated the back trace.
ErrorStr
Translates an error or status code
into a textual description.
const char* iplErrorStr(IPLStatus
status
);
status
Code that indicates the type of error
(see Table 3-1, “iplError() Status Codes”).