Correct, and not only a specific instance of HTTPError, but a specific instance of a 404 error, or any error for that matter.braydon fuller <cou...@braydon.com> wrote:(...)Braydon, It seems your patch doesn't solve the same kind of problem. Ticket #800 is about providing a way to customize the error page returned by default by every HTTPError. But your proposal, if I understand it well, is about adding a parameter "body" to HTTPError, in order to customize the error page returned by a specific instance of HTTPError. If I am correct, we probably should discuss this in a dedicated thread, with a descriptive title.
I have also made a patch. Here I am able to send a complete html page
rather than a message:
http://groups.google.com/group/cherrypy-devel/browse_frm/thread/7ab58f345d8e650c
You send the whole page as "body", similar as sending a "message":
def foobar(uri):
try:
location = get_uri(uri)
data = get_data(location)
success = Template(file=filename, searchList=[data])
except:
error = Template(file=filename, searchList=[locals()])
raise HTTPError(404, body=error)
foobar.exposed = True