commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r6277 - trunk/gnue-common/src/apps


From: johannes
Subject: r6277 - trunk/gnue-common/src/apps
Date: Mon, 13 Sep 2004 07:22:18 -0500 (CDT)

Author: johannes
Date: 2004-09-13 07:22:17 -0500 (Mon, 13 Sep 2004)
New Revision: 6277

Modified:
   trunk/gnue-common/src/apps/GBaseApp.py
Log:
exception hook now uses a function showException () so it could be overriden by 
descendants of GBaseApp


Modified: trunk/gnue-common/src/apps/GBaseApp.py
===================================================================
--- trunk/gnue-common/src/apps/GBaseApp.py      2004-09-13 11:10:11 UTC (rev 
6276)
+++ trunk/gnue-common/src/apps/GBaseApp.py      2004-09-13 12:22:17 UTC (rev 
6277)
@@ -569,13 +569,26 @@
   def excepthook (self, etype, value, traceback):
     """
     This function catches an exception and evaluates it using getException ().
-    Depending on the exception group it just drops the command and message to
-    stderr or writes a complete traceback to stderr.
+    The exception-tuple is then passed to showException (), which might get
+    overriden by a descendant.
     """
     sys.excepthook = sys.__excepthook__
-    (group, name, message, detail) = errors.getException (None, etype, value,
-        traceback)
+    self.showException (*errors.getException (None, etype, value, traceback))
 
+
+  # ---------------------------------------------------------------------------
+  # Show an exception
+  # ---------------------------------------------------------------------------
+
+  def showException (self, group, name, message, detail):
+    """
+    This function shows an exception specified by the given parameters.
+    @param group: Exception group ('system', 'admin', 'application', 'user')
+    @param name: Name of the exception
+    @param message: Message of the exception
+    @param detail: Detail of the exception (usually holding a traceback)
+    """
+
     if group in ['user', 'admin']:
       sys.__stderr__.write ("%s: %s\n" % (self.COMMAND, o(message)))
       sys.__stderr__.write ("%s\n" % \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]