[Zope3-dev] Re: Traversal without hiding deep exceptions
Jim Fulton
jim at zope.com
Mon Oct 18 06:53:32 EDT 2004
Steve Alexander wrote:
...
> But, I think we need to do better than the Python behaviour for Zope 3.
> Zope 3 is all about integrating software in interesting and complex
> ways. To make the process of integration workable, we need to avoid
> hiding such exceptions.
>
> There is a way around this: Some code in the interface package uses a
> trick from Phillip Eby to see whether an exception was raised
> "immediately" or "deeply" by examining the depth of the traceback. I've
> put this code into a function:
>
> import sys
>
> def deep_exception():
> return sys.exc_info()[2].tb_next is not None
Cool.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list