18 |
import traceback |
import traceback |
19 |
|
|
20 |
from wxPython.wx import * |
from wxPython.wx import * |
|
from wxPython.lib.dialogs import wxScrolledMessageDialog |
|
21 |
|
|
22 |
from Thuban.Lib.connector import Publisher |
from Thuban.Lib.connector import Publisher |
23 |
from Thuban.Lib.fileutil import get_application_dir |
from Thuban.Lib.fileutil import get_application_dir |
34 |
import tree |
import tree |
35 |
import mainwindow |
import mainwindow |
36 |
import dbdialog |
import dbdialog |
37 |
|
import exceptiondialog |
38 |
|
|
39 |
from messages import SESSION_REPLACED |
from messages import SESSION_REPLACED |
40 |
|
|
259 |
try: |
try: |
260 |
lines = traceback.format_exception(exc_type, exc_value, |
lines = traceback.format_exception(exc_type, exc_value, |
261 |
exc_traceback) |
exc_traceback) |
262 |
message = "An unhandled exception occurred:\n%s\n" % exc_value+\ |
message = _("An unhandled exception occurred:\n%s\n") % exc_value+\ |
263 |
"(please report to " \ |
_("(please report to") +\ |
264 |
"http://thuban.intevation.org/bugtracker.html)"\ |
" http://thuban.intevation.org/bugtracker.html)"\ |
265 |
"\n\n\n"+\ |
"\n\n\n"+\ |
266 |
"".join(lines) |
"".join(lines) |
267 |
print message |
print message |
269 |
# We don't use an explicit parent here because this method might |
# We don't use an explicit parent here because this method might |
270 |
# be called in circumstances where the main window doesn't exist |
# be called in circumstances where the main window doesn't exist |
271 |
# anymore. |
# anymore. |
272 |
dlg = wxScrolledMessageDialog(None, message, |
exceptiondialog.run_exception_dialog(None, message) |
|
"Thuban: Internal Error") |
|
|
dlg.ShowModal() |
|
|
dlg.Destroy() |
|
273 |
|
|
274 |
finally: |
finally: |
275 |
self.in_exception_dialog = 0 |
self.in_exception_dialog = 0 |