swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Topics  

ommqi Error Handling

There are two classes of external exceptions which can be generated by a call to an ommqi function:

ommqi External Exceptions

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

IBM MQSeries External Exceptions

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:

  1. If MQI0000 is thrown, then the details of the error can be retrieved using mq-get-function-status. This fills in the passed integer shelf with two items, one with key "CompCode", the other with key "Reason"
  2. If MQI0001 is thrown, then the IBM MQSeries call generated multiple errors (which can occur, for example, when opening multiple queues with a single call to mq-open). The error details can be retrieved using mq-get-entire-return-status, which adds an entry in the passed mq-response-record shelf for each error. The CompCode and Reason stored in each record can then be retrieved via mq-get-response-record

Warnings versus Errors

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.

Logging

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).

Example

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 Topics
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:35:14 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.