[Zope] error_type in Python Script?

Kyler Laird Kyler@Lairds.com
Thu, 25 Jul 2002 09:36:21 -0500


On Thu, Jul 25, 2002 at 10:30:19AM -0400, Jim Gallacher wrote:

> Here is my __init__.py file:
> 
> # Global module assertions for Python scripts
> from Products.PythonScripts.Utility import allow_module
> allow_module('sys.exc_info')
> 
> You can now access the error_type and error_value from a python script
> error_type = sys.exc_info()[0]
> error_value = sys.exc_info()[1]

Yes, I've been doing a lot of this stuff lately, but
I had really hoped to avoid it.

> It still seems to me there should be a standard way to do this within
> Zope but this worked for me in a pinch.

Indeed.  Python's error handling mechanism is so
graceful that it's a shame to discourage its use in
Zope.

Well, at least I can stop looking for an existing
solution.  You've saved me some searching.

Thank you.

--kyler