OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Recovering From Errors
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
6-8
Primary and Secondary Codes
DEFINE printfd( x,y ) =
BEGIN
outline ':=' x -> @outptr;
CALL NUMOUT (tempstr, y, 10 , 5);
outptr ':=' tempstr FOR 5 -> @outptr;
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
-- Print one long integer 'y' at the end of the string 'x':
-- i.e., printfld ("big=",MAX_NUM) gives-> "big= 32767"
DEFINE printfld( x,y ) =
BEGIN
outline ':=' x -> @outptr;
CALL print_long_int (y, output_width, outptr);
@outptr := @outptr[output_width];
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
Primary and Secondary Codes
The primary and secondary codes help you isolate the cause of a warning or error. A
primary code is returned for each call by GPI_STATUS_ . In some cases, the primary
code is the same as the code returned by the status parameter when the procedure
itself failed.
The secondary code is returned only for certain errors. In these cases, the secondary
code provides additional information to complement the primary code. For example, a
possible primary code is MH-RC-NO-SUCH-SESSION. In this case, the secondary
code returns the specific session identifier.
A complete listing of all primary and secondary codes is provided in the GPI Reference
Manual.
Error Class
The error class indicates the severity of the error. Error class can be used to develop
recovery actions. The GPI Reference Manual lists possible recovery actions for each
type of error class. Table 6-1 shows a summary of these actions.
Note. The print_long_int procedure is listed in full in Appendix A, TAL Program Example.
Table 6-1. GPI_STATUS_ Error Classes (page 1 of 2)
Error class Value Recovery
MH-RC-SUCCESS 0 None required
MH-RC-WARNING 10 None required
MH-RC-IMMINENT 20 None required