[PEAK] Sitemap driven error handling

Radek Kanovsky rk at dat.cz
Fri Jan 28 11:30:34 EST 2005


On Thu, Jan 27, 2005 at 10:51:04AM -0500, Phillip J. Eby wrote:

> It's a nice idea; I may not want to incorporate it into the current
> version, though, as the error handling will become a generic function
> at some point and thus the registration mechanism for it might be
> quite different than for a view.

I am voting for including some error handling configuration mechanism
into sitemaps. Error handler registration is partly configuration act.
Now we have .ini files and one or more sitemap.xml files in typical web
application. Generic function predicates will become third configuration
source. Controling error handler registration from sitemap is more
convenient for me than writing predicates directly into .py files and
dispersing configuration data to many sources.

> It will, however, support handling non-IWebException errors in any event.

There is possibility to convert all exceptions to context-aware
exceptions (as IWebExceptions are) by inspecting traceback and finding
topmost TraversalContext on stack (probably imposible without touching
traversing code). I have seen something similar in Python Cookbook but
cannot find it now.

I am currently using start context for non-IWebExceptions. That is
the reason why handlers for non-IWebExceptions should be defined
in root <location>.

RadekK



More information about the PEAK mailing list