[Zope-Checkins] CVS: Zope3/lib/python/Zope/Exceptions - ExceptionFormatter.py:1.1.2.7

Shane Hathaway shane@cvs.zope.org
Mon, 29 Apr 2002 10:49:44 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Exceptions
In directory cvs.zope.org:/tmp/cvs-serv28401

Modified Files:
      Tag: Zope-3x-branch
	ExceptionFormatter.py 
Log Message:
Catch some exceptions at a lower level so that user code doesn't prevent the tracebacks from including important info.

=== Zope3/lib/python/Zope/Exceptions/ExceptionFormatter.py 1.1.2.6 => 1.1.2.7 ===
         getInfo = getattr(supplement, 'getInfo', None)
         if getInfo is not None:
-            extra = getInfo()
-            if extra:
-                result.append(extra)
+            try:
+                extra = getInfo()
+                if extra:
+                    result.append(extra)
+            except:
+                if DEBUG_EXCEPTION_FORMATTER:
+                    import traceback
+                    traceback.print_exc()
+                # else just swallow the exception.
         return result
 
     def formatTracebackInfo(self, tbi):
@@ -174,7 +180,10 @@
             if tbi is not None:
                 result.append(self.formatTracebackInfo(tbi))
         except:
-            pass
+            if DEBUG_EXCEPTION_FORMATTER:
+                import traceback
+                traceback.print_exc()
+            # else just swallow the exception.
 
         return self.line_sep.join(result)