Catch occasional exceptions - curses

Thomas Lindgaard thomas at it-snedkeren.BLACK_HOLE.dk
Wed Jul 28 18:19:56 EDT 2004


Hello

I'm almost done with my webcrawler with a nice curses interface. But every
once in a while an exception is thrown and not caught, and because of the
use of curses I can't figure out which exceptions are thrown and from
where.

Is the a way to catch all exceptions not handled elsewhere and print them
to my log window? IE. something like:

if __name__ == 'main':
  try:
    # the whole program (more or less)
  except CatchAllExceptionsInSomeMagicWay:
    printExceptionToLog()

-- 
Regards
/Thomas




More information about the Python-list mailing list