Each MQAX object includes properties to hold error information and a method to reset or clear them. The properties are:
The method is:
Your MQAX script or application invokes an MQAX object's method, or accesses or updates a property of the MQAX object:
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.
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.
The following rules describe how raising exceptions are handled:
This is a special case because the CompletionCode and ReasonCode are not always updated:
The MQSession class has a method ReasonCodeName which may be used to replace a WebSphere MQ reason code with a symbolic name. This is especially useful while developing programs where unexpected errors may occur. However, the name is not ideal for presentation to end users.
Each class also has a property ReasonName, that returns the symbolic name of the current reason code for that class.