Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling
Message
 
To
14/01/2001 08:54:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00463508
Message ID:
00463612
Views:
12
>Hi,
> How could I have ON ERROR DOError() and fire object.ERROR() at the same time?
>
>Once untrapped error occured in method, I would like to save all of value the local variable into MEM file. I tried to issue SAVE TO statement in object.error(), however, since the variables are local, ERROR event failed to save the variables. Therefore, I place SAVE TO statement in every method with ON ERROR.
>Yes, it work but it is not IF there are codes in ERROR event.
>How to "fired" both?
>
>Thank you

Hi John,

Any object-level Error method will take precedence over an ON ERROR handler. The error will be detected by the error-handling object with the closest method in the program stack to the point of error. By "error-handling object" I mean an object that has a non-empty Error method, or is based on such a class. The ON ERROR handler will only come into play if no Error method is triggered. That isn't to say that you couldn't have a common procedure used by both of these types of handlers, but as you noted, this is not going to be able to display the local variables in the procedure where the error occurred.

If you're looking for a general approach that will make it easier to diagnose and debug unexpected errors, I suggest you take a look at my ErrHandler forum at http://www.ideaxchg.com/ix07/er/_sys/toccontu.htm. You can review the documentation, download the source code, try out the demo application, and post your questions or comments in a public discussion area devoted exclusively to the support of this error handling facility.

Mike
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform