[Zope-Checkins] CVS: Releases/Zope/lib/python/OFS - SimpleItem.py:1.92.16.1

Evan Simpson evan@zope.com
Mon, 8 Jul 2002 17:45:55 -0400


Update of /cvs-repository/Releases/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv27820/lib/python/OFS

Modified Files:
      Tag: Zope-2_5-branch
	SimpleItem.py 
Log Message:
Backport sane handling of exception during standard_error_message process.


=== Releases/Zope/lib/python/OFS/SimpleItem.py 1.92 => 1.92.16.1 ===
 from Acquisition import aq_base
 import time
+from zLOG import LOG, BLATHER
 
 import marshal
 import ZDOM
@@ -198,7 +199,18 @@
                     v = s(**kwargs)
                 else:
                     v = HTML.__call__(s, client, REQUEST, **kwargs)
-            except: v = error_value or "Sorry, an error occurred"
+            except:
+                LOG('OFS', BLATHER,
+                    'Exception while rendering an error message',
+                    error=sys.exc_info())
+                try:
+                    strv = str(error_value)
+                except:
+                    strv = ('<unprintable %s object>' %
+                            str(type(error_value).__name__))
+                v = strv + (
+                    " (Also, an error occurred while attempting "
+                    "to render the standard error message.)")
             raise error_type, v, tb
         finally:
             if hasattr(self, '_v_eek'): del self._v_eek