If the error occurs during the start or shut-down of Active FoxPro Pages 3.0 the only way to notice it is in the event log or in the ControlCenter. If on the other hand the error occurs while a Web request is being processed, an HTTP error message will be returned to the client. AFP 3.0 reacts essentially with one of two HTTP error messages.
Error 404 is returned if the file was not found. The cause for this may be a faulty input by the user. Other causes may be the Web server configuration, a setting in the user privileges, or the afp.config. The latter is the case if you want to use file extensions in AFP 3.0 that are different from those that have been set as defaults. To do this, the Web server has to be set up accordingly. You will also have to enter all valid extensions in afp.config under config/afp/server/valid-extensions. With this additional filter you may also direct risky extensions including DBF, PRG, etc. to the AFP without having to be concerned that AFP or the Web server will return their content.
In almost all other cases AFP will return error 500. The definition of the HTTP protocol explains that this error is returned whenever an error occurs during processing that can not be assigned to any of the other defined error codes. Internal Server Error will be returned whenever there has been an error inside AFP 3.0 itself, if a configuration problem was identified or if an error occurred in your documents and you failed to handle it in an error event.
HTTP errors are in actual fact response codes. Aside from the error codes 404 and 500 mentioned above AFP 3.0 will for example return code 200 whenever a page was successfully sent. You can add a HTML document to every HTTP error code. For code 200 this will obviously be the .afp file you generated. But even in error cases you can send along a file. The AFP standard message is composed of a brief two-line error notice.
In a Web server you can normally define which file is to be displayed for which error code. AFP can not take advantage of this configuration. AFP is Web server specific and is not part of the ISAPI definition. ISAPI is the name of the interface used by AFP to access the Web server. If you want to use the same data for normal pages and for AFP, you will have to configure AFP as described below in such a manner that you read out and return the defined error files of the Web server.
The Web browser, too, can display HTML content for errors. The error files of the Microsoft Internet Explorer, for instance, are absolutely identical to those of the Microsoft Internet Information Services Server (IIS). The Internet Explorer displays these built-in HTML pages whenever the server error message contains no HTML code. In this case, Internet Explorer interprets the phrase "no HTML code" very liberally: even if the error message of the server is just too short for its taste it will replace it with a built-in message. For this reason you should make sure that your error messages are of sufficient length.