Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Handling Errors | Using BrokerErrors | Getting the Error Code
 
Getting the Error Code
If your application detects an error after calling an webMethods Broker library function, you may use the awGetErrorCode function to obtain the error code. The possible error code values and their meanings are described in Managing Event Types.
The following example illustrates how to obtain an error code from a BrokerError:
BrokerError err;
long errcode;
. . .
err = awNewBrokerClient(broker_host, broker_name,
NULL, client_group, "Publish Sample #1",NULL, &c);
if (err != AW_NO_ERROR) {
/* process the error */
errcode = awGetErrorCode( err);
. . .