[wxPython-users] Better exception handling

Robin Dunn robin at alldunn.com
Thu Jun 28 10:51:17 PDT 2007


Chris Mellon wrote:
> On 6/28/07, Jorgen Bodde <jorgen.maillist at gmail.com> wrote:
>> Hi All,
>>
>> I love wxPython! One thing that worries me for my end-users is the
>> inability to see potential errors. When my GUI app is ran from a
>> console window, the exception is thrown in there. But when somethign
>> happens and the console window is not there, I would like to see an
>> error window similar to the stack walker. The way it is now, errors
>> and exceptions are eaten if I rename my app's extension to myapp.pyw
>> ..
>>
>> I would not like that as it leads to undesired behaviour and people
>> not seeing an error and think a particular button does not do anything
>> can cause more harm then showing an error dialog. Also if there is no
>> feedback, not many people will file a report.
>>
>> Is there a way to get errors back from python's exceptions when there
>> is no console window??
>>
>> Regards,
>> - Jorgen
>>
> 
> The default behavior is for all output (including uncaught exceptions)
> to be show in a popup frame which will be created on demand. You can
> configure this in several ways with the argument to your wx.App
> constructor. You probably have redirect=False, if it prints to the
> command window you were launched in.

Also, you can change the class used for creating the output window to 
some class that you write by setting wx.App.outputWindowClass.  For 
example Chandler uses this to put the error output in a window that can 
be used for emailing the error text and other info to QA.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list