Dont report exceptions in error handler.

This commit is contained in:
Kovid Goyal 2007-11-12 04:20:03 +00:00
parent 5e19ae43e1
commit 4b822e533c

View File

@ -24,11 +24,14 @@ class MainWindow(QMainWindow):
QMainWindow.__init__(self, parent) QMainWindow.__init__(self, parent)
def unhandled_exception(self, type, value, tb): def unhandled_exception(self, type, value, tb):
sio = StringIO.StringIO() try:
traceback.print_exception(type, value, tb, file=sio) sio = StringIO.StringIO()
fe = sio.getvalue() traceback.print_exception(type, value, tb, file=sio)
print >>sys.stderr, fe fe = sio.getvalue()
msg = '<p><b>' + unicode(str(value), 'utf8', 'replace') + '</b></p>' print >>sys.stderr, fe
msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>' msg = '<p><b>' + unicode(str(value), 'utf8', 'replace') + '</b></p>'
d = ConversionErrorDialog(self, 'ERROR: Unhandled exception', msg) msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>'
d.exec_() d = ConversionErrorDialog(self, 'ERROR: Unhandled exception', msg)
d.exec_()
except:
pass