11.1 System Errors

The Oracle Tuxedo system uses the tperrno(5) variable to supply information to a process when a function fails. All ATMI functions that normally return an integer or pointer return -1 or NULL, respectively, on error and set tperrno() to a value that describes the nature of the error. When a function does not return to its caller, as in the case of tpreturn() or tpforward(), which are used to terminate a service routine, the only way the system can communicate success or failure is through the variable tperrno() in the requester.

The tperrordetail(3c) and tpstrerrordetail(3c) functions can be used to obtain additional detail about an error in the most recent Oracle Tuxedo system call on the current thread. tperrordetail() returns an integer (with an associated symbolic name) which is then used as an argument to tpstrerrordetail() to retrieve a pointer to a string that contains the error message. The pointer can then be used as an argument to userlog(3c) or fprintf(). For a list of the symbolic names that can be returned, refer to tperrordetail(3c) in the Oracle Tuxedo ATMI C Function Reference.

tpurcode(5) is used to communicate user-defined conditions only. The system sets the value of tpurcode to the value of the rcode argument of tpreturn(). The system sets tpurcode, regardless of the value of the rval argument of tpreturn(), unless an error is encountered by tpreturn() or a transaction timeout occurs.

The codes returned in tperrno(5) represent categories of errors, which are listed in the following table.

Table 11-1 tperrno Error Categories

Error Category tperrno Values
Abort TPEABORT2
Oracle Tuxedo system1 TPESYSTEM
Call descriptor TPELIMIT and TPEBADDESC
Conversational TPEVENT
Duplicate operation TPEMATCH
General communication TPESVCFAIL, TPESVCERR, TPEBLOCK, and TPGOTSIG
Heuristic decision TPEHAZARD2 and TPEHEURISTIC2
Invalid argument1 TPEINVAL
MIB TPEMIB
No entry TPENOENT
Operating system1 TPEOS
Permission TPEPERM
Protocol1 TPEPROTO
Queuing TPEDIAGNOSTIC
Release compatibility TPERELEASE
Resource manager TPERMERR
Timeout TPETIME
Transaction TPETRAN2
Typed buffer mismatch TPEITYPE and TPEOTYPE
1. Applicable to all ATMI functions for which failure is reported by the value returned in tperrno(5).
2. Refer to Fatal Transaction Errors for more information on this error category.

As footnote 1 shows, four categories of errors are reported by tperrno(5) and are applicable to all ATMI functions. The remaining categories are used only for specific ATMI functions. The following sections describe some error categories in detail.