Links are not active on this page.
 Exception Class (Visual FoxPro)

When an error occurs in the TRY block within a TRY...CATCH...FINALLY error handling structure, Visual FoxPro creates an Exception object automatically and uses the VarName memory variable specified in the CATCH TO clause to store a reference to the exception. The THROW command also generates an Exception object. However, if no TRY...CATCH...FINALLY structure traps the thrown exception, Visual FoxPro escalates the exception another error handler or Visual FoxPro's global error handler.

You can define and subclass the Exception class.

Exception 

Expand imageRemarks

Visual FoxPro supports the Exception class only in program (.prg) files.

Exception objects do not support all the various error information, including Component Object Model (COM), Open Database Connectivity (ODBC), and database triggers, that you can usually obtain from the AERROR( ) function. However, you can access AERROR( ) information inside the TRY...CATCH block.

Expand imageExample

 CopyCode imageCopy Code
oError = CREATEOBJECT("exception")

Expand imageSee Also