9. Error Conditions

The following is a definition of the method for handling error conditions in LAS.

All error messages are output using the utility routine c_errmsg(). c_errmsg() outputs an error message in a transportable manner by using the TAE message facility. The error message should be in a "sentence" format (do not place a period at the end). A key (all lower case) is also used. The key is created by using the routine name, a dash, and then a shorthand description. For example, if the copy program encounters an error while reading from the input image, an appropriate key for the output error message would be "copy-read" and an appropriate message would be "Error encountered reading the input file".

If an error is encountered in a service routine, the error message is written to the standard output and control is returned to the application program with an appropriate status code. The application program will then either terminate the process or continue processing depending on the severity of the error. The library routine never terminates the process.

If the error is nonfatal, the application program outpus a message to the user indicating that processing will continue. A standard call to c_errmsg() for this type of error is:

    c_errmsg("Nonfatal error encountered","copy-warn",&nonfatal);
If the error is fatal, the application program outputs a message to the user indicating that the processing is terminating. The application program should use the value of the $DELFLG global as the flag to indicate whether or not to delete image data and associated files before terminating. A standard call to c_errmsg() for this type of error is:

    c_errmsg("Fatal error encountered","copy-fatal",&fatal);