durusmail: quixote-users: PublishError exception handling overhaul
PublishError exception handling overhaul
2002-05-14
2002-05-14
2002-05-14
2002-05-14
PublishError exception handling overhaul
Neil Schemenauer
2002-05-13
The handling of PublishError exceptions in Quixote is currently pretty
confused.  I would like to simplify things while making it easier to
setup Quixote applications.  I've already got something coded and
partially tested but I want some feedback before I commit the change.

First, we define a new special name.  I'm currently using
"_q_exception_handler".  When an instance of PublishError is raised, the
publisher searches for the nearest namespace with a _q_exception_handler
attribute.  That function is called with the request and exception
instance as arguments and should return the error page (e.g. a string).
If the handler doesn't want to handle a particular error it can re-raise
it and the next nearest handler will be found.  Quixote would provide
a default handler.

Is this overkill?  It allows sites to have different error handling for
different parts of the site.  Would anyone actually use it?  Perhaps
only allowing _q_exception_handler in the root namespace would be good
enough.

--
Neil Schemenauer  | MEMS Exchange
Software Engineer                        | http://www.mems-exchange.org/


reply