Issue #668 resolved

Confusion in Documentation (Or non-existant)

Anonymous created an issue

I have spent several hours pouring over documentation of several types trying to figure out how to trap all Errors like unhandled (500), Unknown URL (404), and exceptions. The 404 is okay statically by pointing it to a file, but I prefer dynamic responses. I was able to do this in CherryPy 2.x with a cpOnError, or something like that, and for the life of me I can't seem to get it to work in CherryPy 3.0. It appears to have something to do with hooks and tools, but I can't get the pieces together to make them work. The documents I found relate to several things individually, but there is nothing that tells where (and how) everything has to be all in one example or tutorial.

So if I wanted to respond with a custom dynamic 404 message, is there an example code somewhere, or could it be spelled out more clearly step-by-step?

Thank you

Reported by

Comments (4)

  1. Anonymous

    I just stumbled across the answer when reading about the changes after PyCon. I never realized that there was a "default" path that could be used. The rest of the catches are easy, so this should be the solution I was looking for. I was previously trying to use hooks.

  2. Robert Brewer

    This has been mostly addressed in ErrorsAndExceptions. If someone needs to do more (than is possible by overriding the default error template), let me know and I'll add a section on that to the wiki page.

  3. Log in to comment