Products: using Product's specific exceptions from TTW Python scripts
Hi zopistas... Hmmm seems that the main question is in the title but here's the background... I made a business logic object that must be customized with options and TTW Python scripts. Some of the methods used from Python scripts may raise specific custom exception but I didn't get the way making those exceptions available to Python scripts. As a workaround, I use builtin exceptions like IOError and others in a bad way. What I would like to do... from Products.MyProduct.MyExceptions import InvalidDateRangeError ... try: # do some stuff except InvalidDateRangeError, e: # do other stuff Many thanks in advance for your hint. -- Gilles
On 08.01.2004, at 09:52, Gilles Lenfant wrote: Hi Gilles, Martijn's Formulator product contains an example (in Errors.py): from Products.PythonScripts.Utility import allow_class class FormValidationError(Exception): ... allow_class(FormValidationError)
participants (2)
-
Gilles Lenfant -
Jens Quade