Turbogears2 migration: custom error pages

Alessandro Molina alessandro.molina at gmail.com
Thu Feb 18 11:42:06 UTC 2016


On Thu, Feb 18, 2016 at 12:05 PM, Thomas De Schampheleire <
patrickdepinguin at gmail.com> wrote:
>
> Thanks, for basic 404 it indeed works.
> However, I discovered at least one scenario where it does not:
>

Thanks for pointing that out.
The reason is that when dispatching errors we do not pass through the
middleware stack again, so RoutesMiddleware is not executed again and the
routes dict remains the same as before. This causes our RootController to
dispatch it again to the same route as before which leads to a 404 error
again.

I provided a work-around in
https://bitbucket.org/_amol_/kallithea-tg/commits/5ec7001cd47dece91580d8d533bacf3f0ab0d990
but probably the "correct" solution would be to remove RoutesMiddleware and
perform the route resolution inside RootController so that the route is
resolved every time we perform a dispatch and not only when receiving a
request from the WSGI server.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20160218/41a61c0e/attachment.html>


More information about the kallithea-general mailing list