[Zope3-Users] Intercepting exceptions in z3c.pagelets

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jun 25 10:45:18 EDT 2009


On Wednesday 24 June 2009, andrew wrote:
> Does anyone here have any advice on the best (or any) way to intercept
> exceptions in z3c.pagelets ? I want to have a catch-all handler that
> handles any exceptions in a pagelet so I can, e.g., log the error and
> tell someone about it.
>
> I can handle any explicitly-raised Zope exceptions, it's the unexpected
> ones that are causing the problem :-)

This problem is not specific to z3c.pagelet.

The publisher catches all errors and reports them to the error reporting 
utility. Note that the error reporting utility also forwards the exception to 
the logs. Next the publisher looks up a view for the error and displays it.

This gives you several ways to hook into the error handling.

- Have specific exception log handlers that send out E-mail. This is a matter 
of configuration in zope.conf.

- Write custom error views. You then have full control of what you want to do.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"


More information about the Zope3-users mailing list