[PythonCAD] Seeking code suggestions when handling exceptions

Eric Wilhelm ewilhelm at sbcglobal.net
Thu May 19 18:22:32 CEST 2005


# The following was supposedly scribed by
# Noel Grandin
# on Thursday 19 May 2005 08:43 am:

>>the program as robust as possible is what I'm aiming for, so I would
>>really hope to devise some approach better than an abrupt failure.
>
>That is pretty much what I do - my central exception handler
>allows the user to click continue and keep working, even if some
> plugin blew up.

Maybe save a .crash file when you enter the exception handler (then 
delete  it if you make it back out.)  So if everything does go down, 
you can recover if you hadn't saved.  You may need to use the undo 
data, particularly if the error came from the data-structure (e.g. a 
key error or something.)  Or, you could just pickle a brain-dump and 
then code a recovery function that is able to step through (getting as 
far as possible if the crash was caused by some kind of data 
corruption.)

--Eric
-- 
[...proprietary software is better than gpl because...] "There is value 
in having somebody you can write checks to, and they fix bugs." 
  -- Mike McNamara (president of a commercial software company)
---------------------------------------------
    http://scratchcomputing.com
---------------------------------------------


More information about the PythonCAD mailing list