[Zope] Exception handling and Site Error Log

Dieter Maurer dieter at handshake.de
Thu Apr 22 19:17:25 EDT 2004


Tim Edwards wrote at 2004-4-22 12:28 +0800:
>We have a lot of Python code in .py files run via External Methods for an
>application we are developing. I have a bit of a dilema about the exception
>handling. I find that if I catch exceptions in the External Methods (so that
>I can display a nice error page to the user) nothing is logged to the Site
>Error log. If I remove all try-exception blocks from the code any errors
>throw up the standard Zope error page and log to the Site Error Log.

You definitely should not catch exceptions yourself.
You risk to get your databases (ZODB and relational databases)
in an inconsistent state unless you raise again an exception.

>Is there a way to show the user a custom error page and still have the error
>logged to the Site Error Log?

You customize "standard_error_message" ...

-- 
Dieter



More information about the Zope mailing list