OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
Recovering From Errors
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
6-6
Using the GPI_STATUS_ Procedure
---------------------------------------------------------------------------
-- Function Name: show_gpi_status --
-- --
-- Arguments: status_context IN --
-- --
-- Description: This function calls GPI_STATUS and prints status --
-- information to the screen. It is called if --
-- a warning or an error is detected. It shows --
-- detailed information about the warning or error. --
---------------------------------------------------------------------------
PROC show_gpi_status (status_context);
INT status_context;
BEGIN
INT
structure_size, -- Size of the structure
local_rc, -- Return code from the function call
local_session, -- Session identifier from the error
request_type, -- Request type for the most recent error
old_status, -- The original status for the most recent error
error_class, -- The class of the most recent error
primary_code, -- The primary code for the most recent error
secondary_code, -- The secondary code for the most recent error
error_qualifier, -- Qualifying information for the most recent
-- error
error_source, -- The source for the most recent error
info_buffer_len, -- Length of the info buffer
actual_info_len, -- Bytes of error information returned
total_info_len; -- Total number of bytes of error information
STRING .EXT buffer [0:(ZGPI_MAX_STATUS_BUF_LEN -1 )];
STRING .EXT buffer_ptr;
info_buffer_len := ZGPI_MAX_STATUS_BUF_LEN;
local_rc := 0;
local_rc := GPI_STATUS_ ( status_context,
local_session,
request_type,
old_status,
error_class,
primary_code,
secondary_code,
error_qualifier,
error_source,
buffer,
info_buffer_len,
actual_info_len,
total_info_len ) ;
IF (( local_rc = OM_RC_SUCCESS ) OR ( local_rc = ZGPI_RC_WARNING )) THEN
BEGIN
IF ( local_rc = ZGPI_RC_WARNING ) THEN
BEGIN
printfd (" WARNING from GPI_STATUS_! number: ", local_rc );
END;
----------------------------------------------------------------------------
----------------------- Report GPI_STATUS_ Information ---------------------
----------------------------------------------------------------------------
printf (" Error Information ");
printf (" ================= ");
printfd (" Request type: ", request_type);
printfd (" Session: ", local_session);
printfd (" Client RETURN code: ", old_status);