Sun GlassFish Message Queue 4.4 Developer's Guide for C Clients

MQStatusIsError

The MQStatusIsError function returns MQ_TRUE if the status parameter passed to it represents an error.


MQBool MQStatusIsError(const MQStatus status);

Parameters

status

The status returned by any Message Queue function that returns an MQStatus.

Nearly all Message Queue C library functions return an MQStatus. You can pass this status result to the MQStatusIsError function to determine whether your call succeeded. If the MQStatusIsError function returns MQ_TRUE(=1), the function failed; if it returns MQ_FALSE(=0), the function returned successfully.

If the MQStatusIsError returns MQ_TRUE, you can get more information about the error that occurred by passing the status returned to the MQGetStatusCode() function. This function will return the error code associated with the specified status.

To obtain an MQString that describes the error, use the MQGetStatusString() function. To get an error trace associated with the error, use the MQGetErrorTrace() function.