How error handling works

Your MQAX script or application invokes an MQAX object's method, or accesses or updates a property of the MQAX object:

  1. The ReasonCode and CompletionCode in the object concerned are updated.

  2. The ReasonCode and CompletionCode in the MQSession object are also updated with the same information.
    Note:
    See Threading for restrictions on the use of MQSession error codes in threaded applications.

    If the CompletionCode is greater than or equal to the ExceptionThreshold property of MQSession, MQAX throws an exception (number 32000). Use this within your script using the On Error (or equivalent) statement to process it.

  3. Use the Error function to retrieve the associated error string, which will have the form:

    MQAX: CompletionCode=xxx, ReasonCode=xxx, ReasonName=xxx

    For more information on how to use the On Error statements, see the documentation for your ActiveX scripting language.

    Using the CompletionCode and ReasonCode in the MQSession object is very convenient for simple error handlers.

    ReasonName property returns the WebSphere MQ symbolic name for the current value of the ReasonCode.

 

Raising exceptions

The following rules describe how raising exceptions are handled: