9/9

# A Message Queue C API Error Codes

Having found that a Message Queue function has not returned successfully, you can determine the reason by passing the return status of that function to the `MQGetStatusCode` function, which returns the error code associated with the specified status. This appendix lists the error codes that can be returned and provides a description that is associated with that code. You can retrieve the error string (description) by calling the `MQGetStatusString` function.

Some Message Queue functions, when they fail, might return an `MQStatus` result that contains an NSPR or NSS library error code instead of a Message Queue error code. For NSPR and NSS library error codes, the `MQGetStatusString` function returns the symbolic name of the NSPR or NSS library error code. Please see NSPR and NSS public documentation for NSPR and NSS error code symbols and their interpretation at the following locations:

- For NSPR error codes, see the "NSPR Error Handling" chapter at the following site: `http://www.mozilla.org/projects/nspr/reference/html/index.html`

- For NSS error codes, see the "NSS and SSL Error Codes" chapter at the following site: `http://www.mozilla.org/projects/security/pki/nss/ref/ssl/`

When checking a Message Queue function for return errors, you should only reference the Message Queue common error code symbol names in order to maintain maximum compatibility with future releases. For each function, Reference lists the common error codes that can be returned by that function.

For information on error handling, see Table A-1.

## Error Codes

Table A-1 lists the error codes in alphabetical order. For each code listed, it provides a description for the error code and notes whether it is a common error (Common).

Table A-1 Message Queue C Client Error Codes

Code | Common | Description
--- | --- | ---
    MQ_ACK_STATUS_NOT_OK
|  | Acknowledgement status is not OK
    MQ_ADMIN_KEY_AUTH_MISMATCH
|  | Admin key authorization mismatch
    MQ_BAD_VECTOR_INDEX
|  | Bad vector index
    MQ_BASE64_ENCODE_FAILURE
|  | Base 64 encode failure.
    MQ_BASIC_TYPE_SIZE_MISMATCH
|  | Message Queue basic type size mismatch
    MQ_BROKER_BAD_REQUEST
|  | Broker: bad request
    MQ_BROKER_BAD_VERSION
|  | Broker: bad version
    MQ_BROKER_CONFLICT
|  | Broker: conflict
    MQ_BROKER_CONNECTION_CLOSED
     X
| Broker connection is closed.
    MQ_BROKER_ENTITY_TOO_LARGE
|  | Broker: entity too large
    MQ_BROKER_ERROR
|  | Broker: error
    MQ_BROKER_FORBIDDEN
|  | Broker: forbidden
    MQ_BROKER_GONE
|  | Broker: gone
    MQ_BROKER_INVALID_LOGIN
|  | Broker: invalid login
    MQ_BROKER_NOT_ALLOWED
|  | Broker: not allowed
    MQ_BROKER_NOT_FOUND
|  | Broker: not found
    MQ_BROKER_NOT_IMPLEMENTED
|  | Broker: not implemented
    MQ_BROKER_PRECONDITION_FAILED
|  | Broker: precondition failed
    MQ_BROKER_RESOURCE_FULL
|  | Broker: resource full
    MQ_BROKER_TIMEOUT
|  | Broker: timeout
    MQ_BROKER_UNAUTHORIZED
|  | Broker: unauthorized
    MQ_BROKER_UNAVAILABLE
|  | Broker: unavailable
    MQ_CALLBACK_RUNTIME_ERROR
     X
| Callback runtime error occurred
    MQ_CANNOT_UNSUBSCRIBE_ACTIVE_CONSUMER
     X
| Cannot unsubscribe an active consumer.
    MQ_CLIENTID_IN_USE
     X
| Client id already in use
    MQ_CONCURRENT_ACCESS
     X
| Concurrent access
    MQ_CONCURRENT_DEADLOCK
     X
| Operation may cause deadlock
    MQ_CONCURRENT_NOT_OWNER
|  | Concurrent access not owner
    MQ_CONNECTION_CREATE_SESSION_ERROR
|  | Connection failed to create a session.
    MQ_CONNECTION_OPEN_ERROR
|  | Connection failed to open a connection.
    MQ_CONNECTION_START_ERROR
|  | Connection start failed.
    MQ_CONNECTION_UNSUPPORTED_TRANSPORT
     X
| The transport specified is not supported.
    MQ_CONSUMER_CLOSED
     X
| The consumer was closed.
    MQ_CONSUMER_EXCEPTION
|  | An exception occurred on the consumer.
    MQ_CONSUMER_NO_DURABLE_NAME
     X
| There is no durable name specified
    MQ_CONSUMER_NO_SESSION
|  | The consumer has no session.
    MQ_CONSUMER_NOT_FOUND
     X
| Message consumer not found
    MQ_CONSUMER_NOT_IN_SESSION
     X
| The consumer is not part of this session.
    MQ_CONSUMER_NOT_INITIALIZED
|  | The consumer has not been initialized.
    MQ_COULD_NOT_CONNECT_TO_BROKER
     X
| Could not connect to Broker
    MQ_COULD_NOT_CREATE_THREAD
     X
| Could not create thread
    MQ_DESTINATION_CONSUMER_LIMIT_EXCEEDED
     X
| The number of consumers on the destination exceeded limit.
    MQ_DESTINATION_NO_CLASS
|  | The destination does not have a class.
    MQ_DESTINATION_NO_NAME
|  | The destination does not have a name.
    MQ_DESTINATION_NOT_TEMPORARY
|  | The destination is not temporary
    MQ_END_OF_STREAM
|  | End of stream
    MQ_FILE_NOT_FOUND
|  | The property file could not be found
    MQ_FILE_OUTPUT_ERROR
|  | File output error
    MQ_HANDLED_OBJECT_IN_USE
|  | The object could not be deleted because there is another reference to it.
    MQ_HANDLED_OBJECT_INVALID_HANDLE_ERROR
|  | The object is invalid (i.e. it has not been deleted).
    MQ_HANDLED_OBJECT_NO_MORE_HANDLES
|  | A handle could not be allocated because the supply of handles has been exhausted.
    MQ_HASH_TABLE_ALLOCATION_FAILED
|  | The hash table could not be allocated
    MQ_HASH_VALUE_ALREADY_EXISTS
     X
| The hash value already exists in the hash table.
    MQ_ILLEGAL_CLOSE_XA_CONNECTION
     X
| Illegally closed an XA connection
    MQ_INCOMPATIBLE_LIBRARY
     X
| The library is incompatible
    MQ_INPUT_STREAM_ERROR
|  | Input stream error
    MQ_INTERNAL_ERROR
|  | Generic internal error
    MQ_INVALID_ACKNOWLEDGE_MODE
     X
| Invalid acknowledge mode
    MQ_INVALID_AUTHENTICATE_REQUEST
|  | Invalid authenticate request
    MQ_INVALID_CLIENTID
     X
| Invalid client id
    MQ_INVALID_CONSUMER_ID
|  | Invalid consumer id
    MQ_INVALID_DELIVERY_MODE
     X
| Invalid delivery mode.
    MQ_INVALID_DESTINATION_TYPE
     X
| Invalid destination type.
    MQ_INVALID_ITERATOR
|  | Invalid iterator
    MQ_INVALID_MESSAGE_SELECTOR
     X
| Invalid message selector.
    MQ_INVALID_PACKET
|  | Invalid packet
    MQ_INVALID_PACKET_FIELD
|  | Invalid packet field
    MQ_INVALID_PORT
|  | Invalid port
    MQ_INVALID_PRIORITY
     X
| Invalid priority
    MQ_INVALID_RECEIVE_MODE
     X
| Invalid receive mode.
    MQ_INVALID_TRANSACTION_ID
|  | Invalid transaction id
    MQ_INVALID_TYPE_CONVERSION
     X
| The object could not be converted invalid input
    MQ_MD5_HASH_FAILURE
|  | MD5 Hash failure
    MQ_MESSAGE_NO_DESTINATION
|  | The message does not have a destination
    MQ_MESSAGE_NOT_IN_SESSION
     X
| The message was not delivered to the session.
    MQ_NEGATIVE_AMOUNT
|  | Negative amount
    MQ_NO_AUTHENTICATION_HANDLER
|  | No authentication handler
    MQ_NO_CONNECTION
|  | The session's connection has been closed
    MQ_NO_MESSAGE
     X
| There was no message to receive.
    MQ_NO_MESSAGE_PROPERTIES
     X
| There are no message properties
    MQ_NO_REPLY_TO_DESTINATION
     X
| The message does not have a reply to destination.
    MQ_NOT_ASYNC_RECEIVE_MODE
     X
| The session is not in async receive mode.
    MQ_NOT_FOUND
     X
| Not found
    MQ_NOT_IPV4_ADDRESS
|  | Not an IPv4 Address
    MQ_NOT_SYNC_RECEIVE_MODE
     X
| The session is not in sync receive mode.
    MQ_NOT_TRANSACTED_SESSION
     X
| The session is not transacted.
    MQ_NOT_XA_CONNECTION
     X
| The connection is not an XA connection.
    MQ_NULL_PTR_ARG
     X
| NULL pointer passed to method
    MQ_NULL_STRING
|  | The string is `NULL`
    MQ_NUMBER_NOT_INT16
|  | Number not a UINT16
    MQ_OBJECT_NOT_CLONABLE
|  | The object cannot be cloned
    MQ_OUT_OF_MEMORY
     X
| Out of memory
    MQ_PACKET_OUTPUT_ERROR
|  | Packet output error
    MQ_POLL_ERROR
|  | Poll error
    MQ_PORTMAPPER_ERROR
|  | Portmapper error
    MQ_PORTMAPPER_INVALID_INPUT
|  | Portmapper returned invalid.
    MQ_PORTMAPPER_WRONG_VERSION
|  | Portmapper is the wrong version
    MQ_PRODUCER_CLOSED
     X
| Producer closed.
    MQ_PRODUCER_HAS_DESTINATION
     X
| The producer has a specified destination
    MQ_PRODUCER_NO_DESTINATION
     X
| The producer does not have a specified destination.
    MQ_PRODUCER_NOT_IN_SESSION
     X
| The producer is not part of this session
    MQ_PROPERTY_FILE_ERROR
|  | There was an error reading from the property file
    MQ_PROPERTY_NULL
|  | Property is`NULL`.
    MQ_PROPERTY_WRONG_VALUE_TYPE
     X
| Property has the wrong value type
    MQ_PROTOCOL_HANDLER_AUTHENTICATE_FAILED
|  | Authenticating to the broker failed.
    MQ_PROTOCOL_HANDLER_DELETE_DESTINATION_FAILED
|  | Deleting destination failed
    MQ_PROTOCOL_HANDLER_ERROR
|  | Protocol Handler error
    MQ_PROTOCOL_HANDLER_GOODBYE_FAILED
|  | Error in saying goodbye to broker.
    MQ_PROTOCOL_HANDLER_HELLO_FAILED
|  | Error saying hello to the broker.
    MQ_PROTOCOL_HANDLER_READ_ERROR
|  | Reading a packet from the broker failed.
    MQ_PROTOCOL_HANDLER_RESUME_FLOW_FAILED
|  | Error resume flow from broker.
    MQ_PROTOCOL_HANDLER_SET_CLIENTID_FAILED
|  | Setting client id failed.
    MQ_PROTOCOL_HANDLER_START_FAILED
|  | Starting broker connection failed.
    MQ_PROTOCOL_HANDLER_STOP_FAILED
|  | Stopping broker connection failed.
    MQ_PROTOCOL_HANDLER_UNEXPECTED_REPLY
|  | Received an unexpected reply from the broker.
    MQ_PROTOCOL_HANDLER_WRITE_ERROR
|  | Writing a packet to the broker failed.
    MQ_QUEUE_CONSUMER_CANNOT_BE_DURABLE
     X
| A queue consumer cannot be durable
    MQ_READ_CHANNEL_DISPATCH_ERROR
|  | Read channel couldn't dispatch packet.
    MQ_READQTABLE_ERROR
|  | ReadQTable error
    MQ_RECEIVE_QUEUE_CLOSED
|  | The receive queue is closed.
    MQ_RECEIVE_QUEUE_ERROR
|  | The Session is not associated with a connection.
    MQ_REFERENCED_FREED_OBJECT_ERROR
|  | A freed object was referenced.
    MQ_REUSED_CONSUMER_ID
|  | Reused consumer id
    MQ_SEND_NOT_FOUND
     X
| The destination to which this message was sent could not be found.
    MQ_SEND_RESOURCE_FULL
     X
| The destination is full and is rejecting new messages.
    MQ_SEND_TOO_LARGE
     X
| The message exceeds the single message size limit for the server or for the destination.
    MQ_SERIALIZE_BAD_CLASS_UID
|  | Serialize bad class UID
    MQ_SERIALIZE_BAD_HANDLE
|  | Serialize bad handle
    MQ_SERIALIZE_BAD_MAGIC_NUMBER
|  | Serialize bad magic number
    MQ_SERIALIZE_BAD_SUPER_CLASS
|  | Serialize bad super class
    MQ_SERIALIZE_BAD_VERSION
|  | Serialize bad version
    MQ_SERIALIZE_CANNOT_CLONE
|  | Serialize cannot clone
    MQ_SERIALIZE_CORRUPTED_HASHTABLE
|  | Serialize corrupted hashtable
    MQ_SERIALIZE_NO_CLASS_DESC
|  | Serialize no class description
    MQ_SERIALIZE_NOT_CLASS_DEF
|  | Serialize not class definition
    MQ_SERIALIZE_NOT_CLASS_HANDLE
|  | Serialize not a class object
    MQ_SERIALIZE_NOT_HASHTABLE
|  | Serialize not a hashtable
    MQ_SERIALIZE_NOT_OBJECT_HANDLE
|  | Serialize not a handle object
    MQ_SERIALIZE_STRING_CONTAINS_NULL
|  | Serialize string contains`NULL`
    MQ_SERIALIZE_STRING_TOO_BIG
|  | Serialize string too big
    MQ_SERIALIZE_TEST_ERROR
|  | Serialize testing error
    MQ_SERIALIZE_UNEXPECTED_BYTES
|  | Serialize unexpected bytes
    MQ_SERIALIZE_UNRECOGNIZED_CLASS
|  | Serialize unrecognized class
    MQ_SESSION_CLOSED
     X
| Session closed
    MQ_SESSION_NOT_CLIENT_ACK_MODE
     X
| Session is not in client acknowledge mode
    MQ_SOCKET_CLOSE_FAILED
|  | Could not close the socket
    MQ_SOCKET_CONNECT_FAILED
|  | Could not connect socket to the host
    MQ_SOCKET_ERROR
|  | Socket error
    MQ_SOCKET_READ_FAILED
|  | Could not read from the socket
    MQ_SOCKET_SHUTDOWN_FAILED
|  | Could not shutdown socket
    MQ_SOCKET_WRITE_FAILED
|  | Could not write to the socket
    MQ_SSL_ALREADY_INITIALIZED
     X
| SSL has already been initialized
    MQ_SSL_CERT_ERROR
|  | SSL certification error
    MQ_SSL_ERROR
|  | SSL error
    MQ_SSL_INIT_ERROR
|  | SSL initialization error
    MQ_SSL_NOT_INITIALIZED
     X
| SSL not initialized
    MQ_SSL_SOCKET_INIT_ERROR
|  | SSL socket initialization error
    MQ_STATUS_CONNECTION_NOT_CLOSED
     X
| The connection cannot be deleted because it was not closed.
    MQ_STATUS_INVALID_HANDLE
     X
| The handle passed to a function is invalid.
    MQ_STRING_NOT_NUMBER
|  | String not a number
    MQ_SUCCESS
     X
| Success
    MQ_TCP_ALREADY_CONNECTED
|  | TCP already connected.
    MQ_TCP_CONNECTION_CLOSED
|  | TCP connection is closed.
    MQ_TCP_INVALID_PORT
|  | Invalid TCP port.
    MQ_TEMPORARY_DESTINATION_NOT_IN_CONNECTION
     X
| The temporary destination is not in the connection.
    MQ_THREAD_OUTSIDE_XA_TRANSACTION
     X
| The calling thread is not associated with an XA transaction
    MQ_TIMEOUT_EXPIRED
     X
| Timeout expired
    MQ_TRANSACTED_SESSION
     X
| Session is transacted.
    MQ_TRANSACTION_ID_IN_USE
|  | Transaction id in use.
    MQ_TYPE_CONVERSION_OUT_OF_BOUNDS
|  | The object conversion failed because the value is out of bounds
    MQ_UNEXPECTED_ACKNOWLEDGEMENT
|  | Received an unexpected acknowledgement
    MQ_UNEXPECTED_NULL
|  | Unexpected null
    MQ_UNINITIALIZED_STREAM
|  | Uninitialized stream
    MQ_UNRECOGNIZED_PACKET_TYPE
|  | The packet type was unrecognized
    MQ_UNSUPPORTED_ARGUMENT_VALUE
|  | Unsupported argument value
    MQ_UNSUPPORTED_AUTH_TYPE
|  | Unsupported authentication type
    MQ_UNSUPPORTED_MESSAGE_TYPE
|  | The JMS message type is not supported
    MQ_VECTOR_TOO_BIG
|  | Vector too big
    MQ_WRONG_ARG_BUFFER_SIZE
|  | Buffer is the wrong size
    MQ_XA_SESSION_IN_PROGRESS
|  | An XA session is in progress
    MQ_XA_SESSION_NO_TRANSACTION
|  | The XA session has no active transaction