[Zope-Checkins] CVS: Zope2 - BeforeTraverse.py:1.2.90.4
Evan Simpson
evan@digicool.com
Mon, 2 Apr 2001 17:30:22 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZPublisher
In directory korak:/tmp/cvs-serv12567
Modified Files:
Tag: zope-2_3-branch
BeforeTraverse.py
Log Message:
Don't capture all before-traverse exceptions.
--- Updated File BeforeTraverse.py in package Zope2 --
--- BeforeTraverse.py 2001/02/20 14:57:56 1.2.90.3
+++ BeforeTraverse.py 2001/04/02 21:30:20 1.2.90.4
@@ -197,7 +197,13 @@
args = getattr(getattr(meth, 'func_code', None), 'co_argcount', 2)
try:
apply(meth, (container, request, None)[:args])
- except:
+ except (ArithmeticError, AttributeError, FloatingPointError,
+ IOError, ImportError, IndexError, KeyError,
+ OSError, OverflowError, TypeError, ValueError,
+ ZeroDivisionError):
+ # Only catch exceptions that are likely to be logic errors.
+ # We shouldn't catch Redirects, Unauthorizeds, etc. since
+ # the programmer may want to raise them deliberately.
from zLOG import LOG, ERROR
import sys
LOG('BeforeTraverse', ERROR,