Main | April 10, 2008 »

September 10, 2004

09/10/2004

Fancy wxPython Exception Handler

My wxsupportwiz.py module has made it easy to solve most of the bugs that users have found in egoClip. I guess it resembles Mozilla's Quality Feedback Agent, except it doesn't catch crashes in Python extensions, but those are rare.

When an exception goes uncaught, it pops up a little window asking the user if it's okay to send error information to your website. Then it POSTs to your CGI script almost anything you could want about the error:

  • exception type
  • traceback
  • program version
  • Windows version
  • date
  • current directory
  • local variables
  • and it's easy to add more.

In egoClip's case, the CGI presently just e-mails me everything. The CGI could also match the error details to a set of solutions and output the URL to a page of instructions that the module will popup in the user's webbrowser.

To hook it up, just:

import wxsupportwiz
wxsupportwiz.wxAddExceptHook('http://egofile.com/naughty_users.php')

As usual, let me know if you find this useful or if you have suggestions.

My Photo

© 2009 Patrick Roberts