[Zope] Formulator and ZDebug incompatibility

Itai Tavor itai@optusnet.com.au
Tue, 2 Apr 2002 10:49:20 +1000


>Itai Tavor writes:
>  > I posted this question on the Formulator mailing list but it didn't
>  > seem to interest anyone there, so I'm posting it here in hope that
>  > anyone here has some helpful info or a workaround.
>  >
>  > It seems that Formulator is still incompatible with ZDebug. This
>  > problem was discussed briefly back in May 2001
>  > (<http://lists.zope.org/pipermail/zope/2001-May/091103.html>),
>  > related to Formulator 0.9.1 and ZDebug 0.2. I'm using Formulator
>  > 1.2.0 and ZDebug 0.3 in Zope 2.4.4b1, and I have the same problem -
>  > an error message if a form field fails to validate - although the
>  > error message is a bit different this time:
>  >
>  >
>  > Error type: TypeError
>  > Error value: __init__() takes exactly 3 arguments (2 given)
>I think I met this error:
>
>   Then, the offending "__init__" would be an exception constructor.
>
>   ZDebug tries to put its additional information (DTML namespace,
>   authenticated, REQUEST, ...) into the exception it caught.
>   It does this by reraising the exception with additional
>   information.
>
>   This works fine for Zope's standard exceptions. But
>   Formulator exceptions do not play well with this approach.
>
>   I worked around this problem by constructing the new exception
>   in a "try: ... except:". When it gets an exception, I raise
>   the original exception.
>   It's a hack but allowed me to use ZDebug together with Formulator.

Thanks, Dieter. This change worked around the problem for me as well. 
I couldn't figure out what ZDebug was doing from looking at the 
source, but it was easy with your explanation.
-- 
--
Itai Tavor                      -- "Je sautille, donc je suis."    --
itai@optusnet.com.au            --               - Kermit the Frog --
--                                                                 --
-- "If you haven't got your health, you haven't got anything"      --