Reaction to Errors

Software development processes are accompanied by errors and failures. To make your work with Active FoxPro Pages easier we will show you some tricks that help you track the causes of errors that may occur. In this section we will discuss the different systems and show you the possibilities for intervention and modification available to you.

The error handling of AFP 3.0 is exception-based; its function is comparable to the command TRY…CATCH in Visual FoxPro 8.0. If an error occurs, the program execution reverts to a precisely defined point and ignores all code sections in between. Examples of these defined points include the invocation from the Web server, the execution of a single page or of the programs in the cache. Therefore, if an error occurs in a .afp file, AFP will discontinue the execution of the current page but will continue processing the request. Should the error occur while the file is being read from the Web server, processing will be completely abandoned.

As a matter of principle, every error triggers an entry in the event log. If the error occurs during the execution of a request, it will also trigger HTTP 500 internal server error. Should the error occur during the execution of a .afp page, the process branches off to an error handling routine that creates a detailed error report and lets you react to the error. The settings in afp.config determine which AFP error returns are available, and they affect some of their parameters.

More:

Windows Event Log

Simple Text File

HTTP Error

Customized HTML Error Message

Detailed HTML Feedback

APP.Finally()

The Error Event

Structured Exception Handling