[mod_python] Catching errors above handler level?

Graham Dumpleton graham.dumpleton at gmail.com
Fri Apr 6 19:34:06 EDT 2007

On 07/04/07, Bart <scarfboy at gmail.com> wrote:
> I would like to know whether there's a way to work above
> the level of handlers, since I'm thinking about making
> a singular error handler that says things like "Oops,
> the database acted up" without having to add
> the same try-except-except-except-except to all of my
> two dozen or so handlers.
> If possible, it may be interesting in other ways, such as making a
> nice exception formatter too, like moimoin's (if memory serves).
> I also wonder whether it's simple to add automatic me-notification of
> things like HTTP 404 and 500 errors as well as python exceptions.
> Can at least the HTTP error bit be done by falling through to a
> python/php errordocument page?
> Can it be done Inside mod_python? (which would have the possible
> upside of being able to  report context variables too, but I can live
> without that)

This has been asked before. To do it the Apache way would need changes
to mod_python. See:


for more details.


More information about the Mod_python mailing list