[Zope] Exceptions and Python Scripts

Chris Withers chrisw@nipltd.com
Wed, 07 Feb 2001 13:35:10 +0000


Hi,

I'd like to do a try...except in a Python Script.

Unfortunately, it doesn't look like I'm allowed to import the exceptions module:

Error Type: ImportError
Error Value: import of "Exceptions" is unauthorized

Is that intended? Where should I get hold of exception classes to use in Python
Scripts?

To make matters worse, a lot of Zope's internals still throw string based
errors, so a very general except clause is the only way to catch them.
Unfortunately, the only way to analyise those exceptions is to use
sys.exec_info(), but using that in a python script always throws up an
authenticatino box.

Any ideas how to solve these problems?

cheers,

Chris