Turbogears2 migration: custom error pages

Alessandro Molina alessandro.molina at gmail.com
Thu Feb 18 07:39:00 UTC 2016


On Wed, Feb 17, 2016 at 10:36 PM, Thomas De Schampheleire <
patrickdepinguin at gmail.com> wrote:

> I noticed that our custom error pages (e.g. on 404) do not work.
>
> Do you have some idea on what is wrong, or can you guide me in the
> right direction?
>

When an error is detected TurboGears replaces the request with a request
for /error/document.
And that seems to be happening as your logs contain:

2016-02-17 22:32:15.266 INFO  [kallithea.lib.base] IP: 127.0.0.1 User:
<AuthUser('id:1[default]
auth:True')> accessed /error/document

Might it be related to the fact that ErrorController had an empty
__before__? As in TG it is called _before probably you want to rename it as
_before if you want to throw away the behaviour provided by BaseController.

If it still doesn't work you probably want to copy an error controller from
a quickstarted project
https://github.com/TurboGears/tg2devtools/blob/master/devtools/templates/turbogears/%2Bpackage%2B/controllers/error.py_tmpl
and mount it inside RootController through standard TG routing
https://github.com/TurboGears/tg2devtools/blob/master/devtools/templates/turbogears/%2Bpackage%2B/controllers/root.py_tmpl#L57
just to test if it's a controller or configuration problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20160218/38f7e017/attachment.html>


More information about the kallithea-general mailing list