[Zope3-checkins] CVS: Zope3/src/zope/app/services - errorr.py:1.5

Steve Alexander steve@cat-box.net
Thu, 6 Feb 2003 16:07:07 -0500


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv7578/src/zope/app/services

Modified Files:
	errorr.py 
Log Message:
insert nasty workaround to make the logger show the right exception.


=== Zope3/src/zope/app/services/errorr.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/errorr.py:1.4	Tue Jan  7 07:18:35 2003
+++ Zope3/src/zope/app/services/errorr.py	Thu Feb  6 16:07:05 2003
@@ -163,13 +163,17 @@
 
     def _do_copy_to_zlog(self, now, strtype, url, info):
         # XXX info is unused; logging.exception() will call sys.exc_info()
+        # work around this with an evil hack
         when = _rate_restrict_pool.get(strtype,0)
         if now > when:
             next_when = max(when,
                             now - _rate_restrict_burst*_rate_restrict_period)
             next_when += _rate_restrict_period
             _rate_restrict_pool[strtype] = next_when
-            logging.getLogger('SiteError').exception(str(url))
+            try:
+                raise info[0], info[1], info[2]
+            except:
+                logging.getLogger('SiteError').exception(str(url))
 
     def getProperties(self):
         return {