Hi all,
During my migration from TG1 to TG1.5 I realized that "Custom Error
Reporting" now works in a different way.
I have been carefully reading the documentation in
http://turbogears.org/1.5/docs/ErrorReporting.html
Then I inserted in my controller the definition:
-----------------------------
def handle_error():
cherrypy.response.status = 500
cherrypy.response.body = ["<html> <body> Sorry, an error occured </
body> </ html>"]
def error_page(status, message, traceback, version):
return "page not found"
class Root:
_cp_config = {
'error_page.default': error_page,
'request.error_response': handle_error
}
-------------------------------------------------- -----------------
The error_page function is correctly assigned to error_page.default and it
works.
In fact, when the error 404 is triggered, I see the message "page not found
!".
However I can't run the function assigned to "request.error_response."
The function handle_error() actually is assigned to
cherrypy.request.error_response for sure
but it doesn't trigger when an error occurs, instead I get always the python
traceback.
What am I doing wrong?
j
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.