Changeset 3955

Show
Ignore:
Timestamp:
03/16/08 15:57:46 (8 months ago)
Author:
ed
Message:

Wrapped the code to run the design in a try/except block, so that any errors that prevent the design from being run will be caught and reported. Previously such an error would cause a traceback, and the Designer would no longer function properly.

I'd still like to be able to parse the exception and automatically move to that method and the offending line, but since it is happening in a compile() call, that information is not available for direct inspection. Any ideas on this would be welcome!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ide/ClassDesigner.py

    r3940 r3955  
    16681668    def onRunDesign(self, evt): 
    16691669        self.flushCodeEditor() 
    1670         self.CurrentForm.onRunDesign(evt) 
     1670        try: 
     1671            self.CurrentForm.onRunDesign(evt) 
     1672        except StandardError, e: 
     1673            dabo.ui.stop(_("Compilation Error: %s\nCode: %s") % (e.msg, e.text.strip()), 
     1674                    _("Compilation Error")) 
    16711675 
    16721676