From bc7cfba6c701b7a4b1eeb5be9092b37a0cb1ea0d Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 20 Aug 2010 11:47:27 +0100 Subject: [PATCH] Dump a traceback when the GUI gets an unexpected exception --- zeroinstall/0launch-gui/gui.py | 2 +- zeroinstall/0launch-gui/mainwindow.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zeroinstall/0launch-gui/gui.py b/zeroinstall/0launch-gui/gui.py index 5e6de00..e314bab 100644 --- a/zeroinstall/0launch-gui/gui.py +++ b/zeroinstall/0launch-gui/gui.py @@ -93,4 +93,4 @@ class GUIHandler(handler.Handler): def report_error(self, ex, tb = None): if isinstance(ex, download.DownloadAborted): return # No need to tell the user about this, since they caused it - self.mainwindow.report_exception(ex) + self.mainwindow.report_exception(ex, tb = tb) diff --git a/zeroinstall/0launch-gui/mainwindow.py b/zeroinstall/0launch-gui/mainwindow.py index 41cc8ef..5112203 100644 --- a/zeroinstall/0launch-gui/mainwindow.py +++ b/zeroinstall/0launch-gui/mainwindow.py @@ -197,10 +197,10 @@ class MainWindow: self.systray_icon_blocker.trigger() self.systray_icon_blocker = None - def report_exception(self, ex): + def report_exception(self, ex, tb = None): if not isinstance(ex, SafeException): import traceback - traceback.print_exc() + traceback.print_exception(ex, None, tb) if self.systray_icon: self.systray_icon.set_blinking(True) self.systray_icon.set_tooltip(str(ex) + '\n' + _('(click for details)')) -- 2.11.4.GIT