![]() p4GetLastStatusCodes() |
![]() DEVELOPER |
![]() |
p4GetLastStatusCodes()
Return Extended Error Codes
Task Utility
Introduction
The P4API p4GetLastStatusCodes() function is used to get the detailed error codes for the last failed P4API call.
int p4GetLastStatusCodes (
int *pnStatusCode,
int *pnFailReason,
int *pnSuberror
);
Parameters
pnStatusCode
[out] P4API Status Code, as defined in p4api.h. In general, this will be the same value as the return value for this function.
pnFailReason
[out] Failure reason. This varies in meaning for different pnStatusCode values.
pnSubError
[out] The detailed error code. This varies in meaning for different pnStatusCode values.
Return Values
The last non-zero P4API specific error code returned by any P4API call. This will be the same value as returned by a call to p4GetLastError().
Remarks
Use p4GetLastStatusCodes() to obtain the detailed status and error codes following an error. To just check the completion status following an error, use p4GetLastError().
The pnFailReason and pnSubError codes are mainly used for the pnStatusCode values that result from an error being returned by the PROIV Virtual Machine or Kernel Manager. For these values they are the error codes returned by the PROIV kernel and PROIV Kernel Manager respectively.
The kernel originated pnStatusCode values are P4AERR_KERNELSTATUS and P4AERR_KERNEL_TASKFAIL, and are defined in pro4bus.h.
The Kernel Manager-originated pnStatusCode values are P4AERR_DAEMONSTATUS, P4AERR_OPENREPLY and P4AERR_CLOSEREPLY, and are defined in p4bdaemon.h.
For other pnStatusCode values, pnFailReason and pnSubError are normally unused. Exceptions are: pnStatusCode values related to Socket errors: pnFailReason contains the actual socket error code (for Unix kernels) / Winsock error code (for Windows kernels). pnSubError is zero.
Topic ID: 540188