Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 60
Handling SIO Errors
The Break indication can then be picked up later by a CHECK^BREAK procedure call
after you have closed $RECEIVE. CHECK^BREAK can then open $RECEIVE as an
SIO file and check the indication set by the SET^FILE SET^BREAKHIT operation.
Handling SIO Errors
One of the advantages of using SIO procedures is that error handling is automatic. In
addition to providing automatic retry for certain classes of errors, SIO also reports
errors automatically by sending an ASCII error message to a designated error file. By
default, the error file is the home terminal of the process.
SIO treats all errors as either fatal or retryable. Fatal errors always result in a message
being sent to the error file (unless you suppress them as described below). Retryable
errors requiring operator intervention can also cause a message to be sent to the error
file.
SIO error messages give a brief description of the problem. For a complete description
of each message and recommended action, refer to the Guardian Procedure Errors
and Messages Manual.
Handling Error Messages
By default, SIO sends all error messages to the home terminal. The SIO procedures,
however, do enable you to turn off error reporting and to redirect error messages to
another file.
In addition to sending an error message to the error file, each SIO procedure can also
return an error number to your program for specific processing.
Suppressing Error-Message Reporting
You can suppress the printing of error messages either when opening the file or by a
SET^FILE operation on an open file. Each of these methods is described below.
Suppress error-message printing when opening the file by turning off the
P
RINT^ERR^MSG flag for the home terminal as follows:
FLAGS := 0;
FLAGS^MASK := PRINT^ERR^MSG;
CALL OPEN^FILE(COMMON^FCB,
INFILE,
!block^buffer!,
!block^bufferlen!,
FLAGS,
FLAGS^MASK);
Achieve the same effect using the SET^FILE SET^PRINT^ERR^MSG operation with
th
e new-value parameter set to 0:
NEW^VALUE := 0;
CALL SET^FILE(INFILE,