Example error handling for exit functions
The following diagram shows the points (e N ) at which errors can occur. It is only an example to show how exits behave and should be read together with the following table. In this example, two exit functions are invoked both before and after each API call to show the behavior with chained exits.
Application ErrPt Exit function API call ----------- ----- ------------- -------- Start MQCONN --> e1 MQ_INIT_EXIT e2 before MQ_CONNX_EXIT 1 e3 before MQ_CONNX_EXIT 2 e4 --> MQCONN e5 after MQ_CONNX_EXIT 2 e6 after MQ_CONNX_EXIT 1 e7 <-- MQOPEN --> before MQ_OPEN_EXIT 1 e8 before MQ_OPEN_EXIT 2 e9 --> MQOPEN e10 after MQ_OPEN_EXIT 2 e11 after MQ_OPEN_EXIT 1 e12 <-- MQPUT --> before MQ_PUT_EXIT 1 e13 before MQ_PUT_EXIT 2 e14 --> MQPUT e15 after MQ_PUT_EXIT 2 e16 after MQ_PUT_EXIT 1 e17 <-- MQCLOSE --> before MQ_CLOSE_EXIT 1 e18 before MQ_CLOSE_EXIT 2 e19 --> MQCLOSE e20 after MQ_CLOSE_EXIT 2 e21 after MQ_CLOSE_EXIT 1 e22 <-- MQDISC --> before MQ_DISC_EXIT 1 e23 before MQ_DISC_EXIT 2 e24 --> MQDISC e25 after MQ_DISC_EXIT 2 e26 after MQ_DISC_EXIT 1 e27 <-- endThe following table lists the actions to be taken at each error point. Only a subset of the error points have been covered, as the rules shown here can apply to all others. It is the actions that specify the intended behavior in each case.
ErrPt | Description | Actions |
---|---|---|
e1 | Error while setting up environment setup. |
|
e2 | MQ_INIT_EXIT function completes with:
|
|
e3 | Before MQ_CONNX_EXIT 1 function completes with:
|
|
e4 | Before MQ_CONNX_EXIT 2 function completes with:
|
|
e5 | MQCONN call fails. |
|
e6 | After MQ_CONNX_EXIT 2 function completes with:
|
|
e7 | After MQ_CONNX_EXIT 1 function completes with:
|
|
e8 | Before MQ_OPEN_EXIT 1 function completes with:
|
|
e9 | Before MQ_OPEN_EXIT 2 function completes with:
|
|
e10 | MQOPEN call fails |
|
e11 | After MQ_OPEN_EXIT 2 function completes with:
|
|
e25 | After MQ_DISC_EXIT 2 function completes with:
|
|
- The values of MQXCC_* and MQXR2_* and their corresponding actions are defined in How queue managers process exit functions.
Parent topic: Exit failure