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

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 5 Apr 2002 11:01:56 -0500


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

Modified Files:
	SimpleItem.py 
Log Message:
support for exceptions who raise an exception in str(). They get represented as <unprintable X object>

=== Zope/lib/python/OFS/SimpleItem.py 1.96 => 1.97 ===
                 LOG('OFS', ERROR, 'Exception while rendering an error message',
                     error=sys.exc_info())
-                v = str(error_value) + (
+                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