Mark,
Mark Erbaugh wrote:
Is there a place / way to trap unhandled exceptions in a wxPython
application. At first I thought that I could put the call to
App.MainLoop() inside a try: except: block and catch the exception
there, but it seems that unhandled exceptions raised in my code never
make it there.My program uses psycopg to access a PostgreSQL database and if an
unexpected database error occurs, I'd like my program to display a
message with the error information from psycopg and exit. I'm already
handling recoverable errors (integrity violations, etc).For example, one error that I want to abort from would be permission
problems. If somehow the user doesn't have the appropriate permissions
for an operation, I want to display the error so that someone can go
into Postgres and adjust permissions.
Maybe this page will be useful:
http://wiki.wxpython.org/CustomExceptionHandling
I redirect stdout, stderr and I also have a debug flag to log sql calls. Then I have a dialog which shows these log files with an option to email them to support.
Werner