'--------------------------------------------------------------------------- ' ' ErrorHandler() - Global error handler ' ' If a VB runtime error occurs dusing execution of the program, this ' procedure generates an HTTP/1.0 HTML-formatted error message into ' the output file, then exits the program. ' ' This should be armed immediately on entry to the program's main() ' procedure. Any errors that occur in the program are caught, and ' an HTTP/1.0 error messsage is generated into the output file. The ' presence of the HTTP/1.0 on the first line of the output file causes ' NCSA httpd for WIndows to send the output file to the client with no ' interpretation or other header parsing. '--------------------------------------------------------------------------- Sub ErrorHandler(code As Integer) Seek #CGI_OutputFN, 1 ' Rewind output file just in case Send ("HTTP/1.0 500 Internal Error") Send ("Server: " + CGI_ServerSoftware) Send ("Date: " + WebDate(Now)) Send ("Content-type: text/html") Send ("") Send ("") Send ("Error in " + CGI_ExecutablePath + "") Send ("") Send ("

Error in " + CGI_ExecutablePath + "

") Send ("An internal Visual Basic error has occurred in " + CGI_ExecutablePath + ".") Send ("
" + ErrorString + "
") Send ("Please note what you were doing when this problem occurred,") Send ("so we can identify and correct it. Write down the Web page you were using,") Send ("any data you may have entered into a form or search box, and") Send ("anything else that may help us duplicate the problem. Then contact the") Send ("administrator of this service: ") Send ("") Send ("
<" + CGI_ServerAdmin + ">
") Send ("
") Close #CGI_OutputFN '====== End ' Terminate the program '====== End Sub