|
|||||
|
|||||
Related Syntax | |||||
ommqi Error Handling |
There are two classes of external exceptions which can be generated by a call to an ommqi function:
The following external exceptions can be generated by the ommqi library:
OMMQI0001 Maximum length exceeded for field [field] OMMQI0002 Invalid version for this structure OMMQI0003 Invalid field specified for this structure: [structure] OMMQI0004 Attempting to set read-only field [field] OMMQI0005 [field] does not exist in this version of the structure OMMQI0006 Invalid MQLONG specified for field [field] OMMQI0007 Invalid opaque shelf passed as argument OMMQI0008 Out of memory OMMQI0011 Attempting to use a unconnected queue manager OMMQI0013 Attempting to use an unopened queue OMMQI0014 Invalid buffer size OMMQI0015 MQCNO structure has empty ClientConnPtr field OMMQI0016 Specified logging level is out of range OMMQI0017 Selector value is out of range OMMQI0018 Unknown selector value OMMQI0019 Requested feature is not implemented OMMQI0020 At least one attribute selector must be specified OMMQI0021 Required shelf argument is not present OMMQI0022 value exceeds allowable length
If errors occur during the IBM MQSeries call, then one of two external exceptions will be thrown: MQI0000 or MQI0001. If further information about the error is desired, then the IBM MQSeries CompCode and Reason return values for the call can be accessed in the following ways:
IBM MQSeries calls can generate both warnings and errors. By default, no OmniMark exception is thrown if a warning is generated. Call mq-set-throw-on-warnings to set warnings to generate external exceptions. Call mq-get-throw-on-warnings to get the current status of this flag.
Both IBM MQSeries warnings and errors can be forwarded to the OmniMark logging stream. mq-set-logging-level determines which class of errors is logged (none, warnings, warnings + errors).
The following sample catch block prints out the error details when any sort of exception is received from the ommqi library.
catch #external-exception identity catch-id message catch-msg do when catch-id = "MQI0000" local integer res variable mq-get-function-status res output "MQSeries error occurred. CompCode: " || "d"%res{"CompCode"} || " Reason: " || "d"%res{"Reason"} || "%n" else when catch-id = "MQI0001" local mq-response-record mqrr variable local integer res variable mq-get-entire-return-status mqrr repeat over mqrr mq-get-response-record mqrr into res output "MQSeries error occurred. CompCode: " || "d"%res{"CompCode"} || " Reason: " || "d"%res{"Reason"} || "%n" again else output "ommqi Error " || catch-id || " occurred: " || catch-msg || "%n" done
Related Syntax mq-get-entire-return-status mq-get-function-status mq-get-logging-level mq-get-throw-on-warnings mq-set-logging-level mq-set-throw-on-warnings |