[Zope-Checkins] CVS: Zope/lib/python/Zope - __init__.py:1.32
Casey Duncan
casey@zope.com
Fri, 30 Aug 2002 15:17:08 -0400
Update of /cvs-repository/Zope/lib/python/Zope
In directory cvs.zope.org:/tmp/cvs-serv8242/Zope
Modified Files:
__init__.py
Log Message:
After further investigation I found that my change to SimpleItem to sniff the response._error_format was unnecessary (although harmless) since Zope/__init__.py already does this. This check has been removed.
And since error logging was being done in SimpleItem, my previous change prevented xml-rpc exceptions from being logged.
The logging code has now been moved into the Zope/__init__ top-level exception handler to correct this problem. This also seems generally more correct since we no longer rely on SimpleItem to do-the-right-thing.
=== Zope/lib/python/Zope/__init__.py 1.31 => 1.32 ===
--- Zope/lib/python/Zope/__init__.py:1.31 Wed Aug 14 18:10:38 2002
+++ Zope/lib/python/Zope/__init__.py Fri Aug 30 15:17:08 2002
@@ -91,6 +91,7 @@
import ZODB.POSException, ZPublisher, ZPublisher
import ExtensionClass
from zLOG import LOG, WARNING, INFO, BLATHER, log_time
+from Acquisition import aq_acquire
conflict_errors = 0
startup_time = log_time()
def debug(*args, **kw):
@@ -128,6 +129,13 @@
LOG('Conflict traceback', BLATHER, '', error=sys.exc_info())
raise ZPublisher.Retry(t, v, traceback)
if t is ZPublisher.Retry: v.reraise()
+
+ try:
+ log = aq_acquire(published, '__error_log__', containment=1)
+ except AttributeError:
+ error_log_url = ''
+ else:
+ error_log_url = log.raising((t, v, traceback))
if (getattr(REQUEST.get('RESPONSE', None), '_error_format', '')
!='text/html'): raise