Re: crash_message
- Posted by "Boehme, Gabriel" <gboehme at POBOXB1.HQ.MSMAIL.MUSICLAND.COM> Aug 31, 1999
- 449 views
David Cuny wrote: >The ON ERROR routines in BASIC are intended to be exception handlers that >allow you to re-enter your program again. That's not really what I had in >mind, and certainly not something that I expect Robert would ever be >pursuaded to add. > >Instead, I want to be able to trigger a custom data save routine. For >example, if the editor aborts for some reason, the work in progress can be >saved before the application shuts down. The application would not attempt >to recover from the error. I wasn't suggesting that the application would try to recover from the error. In fact, I rarely made use of ON ERROR in that way. I mostly used it in the same way you want to use "crash_routine" -- to perform some emergency shutdown-type actions in the event of a crash. And I'm still not convinced that a "crash_routine" implementation in Euphoria would avoid the sorts of problems I experienced with ON ERROR in BASIC. For example, if we were able to code this... crash_routine(routine_id("myCrashRoutine")) ..and we later encounter an error that would normally cause the program to crash, then the interpreter would instead execute "myCrashRoutine". Now, what happens if "myCrashRoutine" contains errors? Or if it calls the same routine that caused the original crash? Does the program execute "myCrashRoutine" again, looping forever, or do you get two ex.err dumps describing what caused the original crash and what caused the crash routine to crash? The "crash_routine" idea seems useful at first, but the more I look at it, the more it reminds me of all the trouble I was able to get myself into with ON ERROR in BASIC. As far as I'm concerned, the existing "crash_message()" ability is more than adequate. -- Gabriel Boehme