uterr.wbb - Generic Error Display Routine
Syntax
CALL "uterr.wbb",errnum,linenum,progname$
Description
Handling unexpected errors in CGI applications is different from terminal-based applications because there is no direct channel to the end-user. This routine provides an simple method of notifying the user of a problem. Typically, after CALLing this routine, the program exits Business BASIC. To call this in PRO/5 use: CALL "uterr.wbb",err,tcb(5),pgm(-2).
The routine generates a simple HTML page, displaying a heading and error specifics. The heading displayed for specific error codes can be controlled by creating global string values called "$errdesc-n". For example, in PRO/5, the following creates a valid message for a missing file error:
dummy$=stbl("$errdesc-12","A missing file error occurred!")
In addition to displaying an HTML page, uterr.wbb also attempts to mail an administrator user a message about the error. To do this, the global string value "$mailerror" should be set to the email address of the administrator. With a host running UNIX, this feature opens a pipe to the UNIX "mail" command and sends a message detailing the error.