VFPUtils Article By: M. Asherman

  | Bottom | Unframe | Help |

VFP Error Handling References

Locate in Contents | (framed)

Locate in Discussion | (framed) 



| Top | Prev Section |

FoxTalk

| Notes | Next Section | Bottom |

Title
Comments
Author Date
MSDN
Best Practices: Error Handling in Visual FoxPro
An excellent introduction to VFP's error handling facilities, explaining in detail how to use them and suggesting ways to avoid their pitfalls.  Doug makes a strong case for introducing the extension of a three-layered approach, adding form-level error handling between the usual object level and global level of error handlers.  I would wager that this is one of the most (if not the most) frequently cited references in all of Fox-dom.
Doug Hennig 6/1996
MSDN
Best Practices: An Error Handling Class for Visual FoxPro
Demonstrates how to build a simple global error handling class that displays a message and gives the user some choices how to proceed (Debug or Cancel).  Doug shows how the global error handler can be used to selectively support context-sensitive error handling logic, and he discusses some of the ways this scheme could be further extended, e.g. to support Retry and error logging.
Doug Hennig 7/1996
Reusable Tools: Error Handling Revisited
Presents a general error handling scheme that combines a global error handler with object-level error handlers, allowing individual objects to either handle their own specific errors or pass errors up the "chain of responsibility".  This entails using Stonefield's library of foundation classes, whose Error event methods all conform to a strict convention for propagating errors up the containership hierarchy and returning user response codes back down to the method that originally trapped the error.  There is a provision for error logging, and the user has the choice to Debug, Continue, Retry, Cancel, or Quit.
Doug Hennig 1/1998
Reusable Tools: Handling Specific Errors
Doug Hennig 2/1998
Reusable Tools: Mining for Gold in the FFC
Doug Hennig 12/1998
MSDN
Reusable Tools: Reporting Errors
Doug Hennig 8/2000

| Top | Prev Section |

Microsoft Knowledge Base

| Notes | Next Section | Bottom |

Title
Comments
Date
MSDN
Q130526 - How to Use the ON ERROR Command and the Error Event
8/20/99
MSDN
Q136071 - DOC: ON ERROR Not Invoked when Error Occurs in Error Event
2/14/00
MSDN
Q136689 - How an ON ERROR Routine Affects the Error Event
2/14/00
MSDN
Q142287 - PRB: Cannot Trap for Error #1739
2/9/00
MSDN
Q142736 - PRB: RETRY Command in Method Causes Visual FoxPro to Quit
2/10/00
MSDN
Q148999 - BUG: ON ERROR Not Called When Update Conflict Occurs in Grid
8/20/99
MSDN
Q151321 - HOWTO: Implement Generic Error Trapping in FoxPro
(Missing from Microsoft's web site, maybe because it's so outmoded.)
This article describes how to use a generic error trapping routine (based on the old ON ERROR command, not the newer Error Event method) and shows a very simple example in the context of testing a table for exclusive use.
10/23/98
MSDN
Q162084 - PRB: Non-Standard RETURN TO MASTER Behavior After LOCATE Error
2/3/00
MSDN
Q178890 - HOWTO: Use ON ERROR To Debug Applications
8/19/99
MSDN
Q179479 - PRB: Problems with Error 2004 and 2005 Commands
8/9/99
MSDN
Q191315 - BUG: ON ERROR Does Not Trap "Alias Not Found" Error
8/20/99
MSDN
Q191591 - BUG: Meaningless or Undocumented Errors in Visual FoxPro 6.0
9/14/00
MSDN

| Top | Prev Section |

Visual FoxPro Help

| Notes | Next Section | Bottom |

Title/Comments MSDN
AERROR( ) Function
Also see Wiki page for this topic.
MSDN
Automation server exception handling in Visual FoxPro 6 SP3 MSDN
CANCEL Command MSDN
COMRETURNERROR( ) Function MSDN
DEBUG Command MSDN
Debugging and Error Handling MSDN
DEBUGOUT Command MSDN
Developing Applications Using the Application Framework MSDN
ERROR Command MSDN
Error Event MSDN
Error Messages A-Z MSDN
Error Messages by Number MSDN
Error Message Parameters MSDN
Error Object (VFP Foundation Class) MSDN
ERROR( ) Function MSDN
General Protection Fault Handling in Visual FoxPro 6 SP3 MSDN
Guidelines for Using Visual FoxPro Foundation Classes MSDN
Handling Run-Time Errors MSDN
LINENO( ) Function MSDN
MESSAGE( ) Function MSDN
ON ERROR Command MSDN
PROGRAM( ) Function MSDN
QUIT Command MSDN
RESUME Command MSDN
RETRY Command MSDN
Run-time Errors for Unsupported Commands in Vfp6t.dll (VFP 6 SP3) MSDN
SET DEVELOPMENT Command MSDN
SET LOGERRORS Command MSDN
SUSPEND Command MSDN
SYS(16) - Executing Program File Name MSDN
SYS(2018) - Error Message Parameter MSDN
Testing and Debugging Applications MSDN
VERSION( ) Function
Use VERSION(2) = 0 as the test to see if under VFP Runtime.
MSDN

| Top | Prev Section |

FoxForumWiki

| Notes | Next Section | Bottom |

Wiki Topic Keyword/Comments Date Last Updated
aError 1999.12.23
AppShutDown 2000.10.19
Assert 1999.11.10
C0000005ExError 2000.09.07
CDXCorruptionChecklist 2000.11.14
ComErrorHandling 1999.11.30
ComErrors 1999.12.01
Compile-TimeErrors 1999.10.09
DefensiveProgramming 1999.12.04
ErrorEvent 1999.10.08
ErrorEventStrategy 1999.11.09
ErrorHandler 1999.12.01
ErrorHandling 2000.06.17
ErrHlr 1999.12.03
ErrorInErrorHandler 1999.10.11
ErrorInformation 1999.10.23
gaError 1999.11.26
InLineErrorHandling 1999.10.28
InlineErrors 1999.10.27
MultipleInheritance 2000.06.24
OleErrors 1999.11.02
OnError 2000.10.13
ParametersByValueOrReference 1999.08.18
SafeErrorHandling 2000.06.29
SafeProcedures 2000.06.21
TrappableErrors 1999.10.09
UnTrappableErrors 2000.07.27
VFPVersion7WishList 2000.11.29

| Top | Prev Section |

Usenet Newsgroups

| Notes | Next Section | Bottom |

Date Subject/Comments Author Newsgroup
12/19/2000 VFP error handling revisited Michael Asherman microsoft.public.fox.programmer.exchange
10/02/2000 Re: What is going on at DevCon? - Multiple Inheritance William Fields microsoft.public.fox.programmer.exchange
08/01/2000 RE: VFP Error Handling Mark Briggs microsoft.public.fox.vfp.oop
07/11/2000 VFP Error Handling Steven Harris microsoft.public.fox.vfp.oop
12/16/1999 Problems Using Error Event and On Error routines Bruce Parlier comp.databases.xbase.fox
microsoft.public.fox.programmer.exchange
02/18/1999 Error method interacting with other methods Richard Candeland microsoft.public.fox.programmer.exchange

| Top | Prev Section |

Universal Thread

| Notes | Next Section | Bottom |

Date Subject/Comments Author Section
12/19/2000 Error Handler Wayne Willingham Visual FoxPro in general
12/08/2000 Error Handling Keith Tonge COM/DCOM and OLE Automation
10/19/2000 Stopping a function from my error handler... Stephane Charbonneau Coding, syntax & commands
10/13/2000 Control init fail, class init fail Michelle Cox Classes - VCX
10/11/2000 Trapping and handling OLE error Allan Williams Coding, syntax & commands
10/09/2000 Help... I have switched of the normal VFP error handling Mark Young Forms & Form designer
10/06/2000 Its Friday, wanna talk about Error Handlers? Mike Helland Chatter
10/05/2000 Error Handling (Shutdown problem) Denis Gavrikov Visual FoxPro in general
08/22/2000 Simple framework Shane Gilbert Visual FoxPro in general
08/15/2000 How to see if file can be used exclusive w/o causing error Larry Moody Coding, syntax & commands
07/31/2000 Global error handler question - one more try Allan Williams Coding, syntax & commands
07/25/2000 Suppress open file dialog? Adam Davis Visual FoxPro in general
07/05/2000 Error handling question Allan Williams Coding, syntax & commands
07/05/2000 Error trapping in a DLL Edward Gioja ActiveX controls in VFP
06/05/2000 Main Error Handler Kenneth Gilbert Jr. Coding, syntax & commands
06/01/2000 Exit cleanly from error Elyse Pomerantz Coding, syntax & commands
04/27/2000 Error() - The Bubble Effect Chad Bourque Object Oriented Programming
04/23/2000 Trapping an Error John Thornton Coding, syntax & commands
03/02/2000 Variable Not Found - Can't Debug Harry Stottle Coding, syntax & commands
02/29/2000 Error handling Jan Dorresteijn Classes - VCX
(work on this section is not yet completed for older UT threads)

| Top | Prev Section |

Notes About Sources

| Next Section | Bottom |

Notes About MSDN Links
Many of the articles listed above may be available both online and on your local copy of MSDN, if it's installed on your machine.  (Links to articles on the web, if available, are attached to the article titles in the first column.)  The MSDN links have been set up to work with my machine's installation of MSDN (10/99) and the separate help update for VFP 6 SP3.  You will almost certainly have to adjust these links to work properly on your own setup, because my CD uses drive letter G: and my installation directories are non-standard.  All of these MSDN links refer to either VFP Help pages installed on my hard drive, or articles found primarily on CD # 3 of the October 1999 version of MSDN Library.

Notes About FoxTalk Articles
Only the first FoxTalk article is publicly accessible on Pinnacle's web site (and it's also in MSDN).  The others require a subscription to Pinnacle Publishing Online.  (I have the printed FoxTalk versions.)

Notes About MS KB Articles
Dates shown in the second column indicate the last review date of the most recent version that I have seen, which won't reflect any more recent updates made by Microsoft since I last checked.  The Microsoft Knowledge Base Search page is at http://search.support.microsoft.com/kb/c.asp.  I last checked all of the above listed MS KB article review dates on 10/4/00.

Notes About VFP Help Topics
Articles that make reference to SP3 in the title are from a separate help file that came with that update.  The rest are from the main VFP6 help file.  Go to http://msdn.microsoft.com/library/devprods/vs6/vfoxpro/foxhelp/vfpstartpage.htm to see the Visual FoxPro Start Page, or use this link to go directly to the start of the A-Z Language Reference for VFP in the MSDN Online Library.

Notes About FoxForumWiki Topics
The FoxForumWiki home page is at http://fox.wikis.com.  Note that there is an accompanying threaded discussion forum at http://www.foxforum.com, but this can only be accessed by registered users (free).  Date Last Updated for listed topics are as of my last review, which was on 12/16/00.

Notes About Usenet Newsgroup Messages
The links in the Subject and Newsgroup column point to web pages provided courtesy of www.deja.com, aka Deja News.  When you go to one of the Deja message pages, click on the "Thread" link to see an outline of the rest of the thread for that message.  (Deja also includes a handy outline of the thread at the bottom of the page, but this feature seems to be screwed up for older messages.)  I used Deja's Power Search against the keywords "Error Handling" (omitting quotes, i.e. the logical and-ing of "Error" and "Handling").  The "Deja Classic" format in threaded organization seems to work best for wading through large searches.  (You can change my links to display in Deja Classic format by inserting "=dnc/" after "http://www.deja.com/" in the URL.)  I reviewed the results of this search on 12/17/00 and culled out a handful of noteworthy threads from a total of 354 hits.  It should be noted that my selection does not include the most prevalent cases, which go something like this:

Question: "I don't understand ... about VFP error handling.  What's the story?"
Answer: "See Doug Hennig's excellent article on the subject."

Notes About Universal Thread Messages
These links will only work if you use a browser window that has been logged on to the Universal Thread, which requires you to be a registered user (free).  Note that UT provides some very handy links at the bottom of the page, which allow you to quickly see a Map or View the Entire Thread all at once.  You can use this link to go to an unframed UT Search Form, which I find useful.  On 12/18/00 I did a search of the last 4 periods (about 2 years' worth), displaying only the top-level message titles for threads containing the exact phrase "error handling"; this yielded 194 hits.  I'm still in the process of reviewing these threads.

| Top | Prev Section |

Further Plans for This Page

| Next Section | Bottom |

This article is still in a preliminary, skeletal form.  Planned changes include:


| Top | Unframe |

 

Copyright © 2000- 2002, SpaceTime Systems