[Zope-dev] Better diagnostics during product load?
Loren Stafford
lstaffor@dynalogic.com
Mon, 21 Feb 2000 17:15:09 -0800
> > Often, when Zope tries to load my product, it logs the simple error
message:
> > 2000-02-21T23:51:57 ERROR(200) Zope Couldn't install MyProduct
> > There is no traceback, not in the log and not in the product screen of
the
> > Control Panel. I presume the problem is syntax errors in the Python code
of
> > the product.
> >
> > How can I get Zope to show me a traceback pointing out the syntax
errors?
>
>
> In the __init__.py for your product, use a try: except to print out the
> traceback.
>
> try:
>
> <product initialization here>
>
> except:
> import traceback
> traceback.print_exc()
>
>
> This will print the traceback to stderr.
>
> -jfarr
Thanks for your suggestion. I tried that, but it didn't help -- same result.
If there's a syntax error in the module, Python won't even execute the
"try...except", will it?
-- Loren