[Zope-Checkins] CVS: Zope/lib/python/Products/SiteErrorLog - SiteErrorLog.py:1.4

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


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

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

=== Zope/lib/python/Products/SiteErrorLog/SiteErrorLog.py 1.3 => 1.4 ===
                         pass
 
+                try:
+                    strv = str(info[1])
+                except:
+                    strv = '<unprintable %s object>' % str(type(info[1]).__name__)
+
                 log = self._getLog()
                 log.append({
                     'type': str(getattr(info[0], '__name__', info[0])),
-                    'value': str(info[1]),
+                    'value': strv,
                     'time': now,
                     'id': str(now) + str(random()), # Low chance of collision
                     'tb_text': tb_text,