Call MQStatusIsError, passing it an MQStatus result for the function whose result you want to test.
If the MQStatusIsError function returns MQ_TRUE , call MQGetStatusCode or MQGetStatusString to identify the error.
If the status code and string information is not sufficient to identify the cause of the error, you can get additional diagnostic information by calling MQGetErrorTrace to obtain the calling thread’s current error trace if this information is available.
Chapter 4, Reference, lists common errors returned for each function. In addition to these errors, the following error codes may be returned by any Message Queue C function:
In addition, the MQ_TIMEOUT_EXPIRED can return from any Message Queue C function that communicates with the Message Queue broker if the connection MQ_ACK_TIMEOUT_PROPERTY is set to a non-zero value.