summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-01-26 11:41:33 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-01-26 11:41:33 +0100
commit2780bf690f1688a6f2a8771e519088abfb1b4439 (patch)
treeb5a2dde9fac29f82e793e845ec976676ac8676e0 /DistUpgrade
parentccfd9f367294b9ef65ac1e1b501ee802a1496445 (diff)
downloadpython-apt-2780bf690f1688a6f2a8771e519088abfb1b4439.tar.gz
* handle exception with the gui and give advice about bug reporting
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index 26fa099c..230c8b47 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -209,6 +209,20 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp):
attrlist.insert(attr)
self.label_status.set_property("attributes", attrlist)
+ # reasonable fault handler
+ sys.excepthook = self._handleException
+
+ def _handleException(self, type, value, tb):
+ import traceback
+ lines = traceback.format_exception(type, value, tb)
+ logging.error("not handled expection:\n%s" % "\n".join(lines))
+ self.error(_("A fatal error occured"),
+ _("During the operation a fatal error occured. "
+ "Please report this as a bug and include the "
+ "files ~/dist-upgrade.log and ~/dist-upgrade-apt.log "
+ "in your report. The upgrade will abort now. "),
+ "\n".join(lines))
+
def create_terminal(self, arg1,arg2,arg3,arg4):
" helper to create a vte terminal "
self._term = vte.Terminal()