I'm trying to retrofit TRY..CATCH (VFP 9, now) into a program that has been around since VFP6...
One very frustrating thing is that if I put TRY...CATCH around my READ EVENTS (in an attempt to make errors recoverable, rather than choking out of the application) then I lose the Call Stack that existed when the exception was thrown.
(I know how to use TRY..CATCH on a closer scope, but the problem remains: If not EVERY routine has a TRY..CATCH in it, an one of those routines throws an error, then it's hard to report the application's status when the error occurs.
If instead, I use ON ERROR, then the error is not recoverable but I can report the actual call stack using a loop and PROGRAM(i) (Yeah, I know you can RETRY or RETURN instead of QUITing in the ON ERROR, but the offending Form doesn't disappear, and it just isn't as Clean as if the program jumped to the CATCH...)
Does anyone have an idea for how to report the offending callstack in a CATCH when the error occurred in a subroutine (Called from a subroutine, called from a subroutine, etc) called from the TRY block?
- Bill
Get the best answers to your questions -- See FAQ481-4875.
One very frustrating thing is that if I put TRY...CATCH around my READ EVENTS (in an attempt to make errors recoverable, rather than choking out of the application) then I lose the Call Stack that existed when the exception was thrown.
(I know how to use TRY..CATCH on a closer scope, but the problem remains: If not EVERY routine has a TRY..CATCH in it, an one of those routines throws an error, then it's hard to report the application's status when the error occurs.
If instead, I use ON ERROR, then the error is not recoverable but I can report the actual call stack using a loop and PROGRAM(i) (Yeah, I know you can RETRY or RETURN instead of QUITing in the ON ERROR, but the offending Form doesn't disappear, and it just isn't as Clean as if the program jumped to the CATCH...)
Does anyone have an idea for how to report the offending callstack in a CATCH when the error occurred in a subroutine (Called from a subroutine, called from a subroutine, etc) called from the TRY block?
- Bill
Get the best answers to your questions -- See FAQ481-4875.