Hi everyone,

I'm trying to upgrade to TG1.1.5.1 and I have a problem with Custom Error Reporting (CherryPy-3.2.4). After having carefully read the documentation at http://www.turbogears.org/1.5/docs/ErrorReporting.html
I decided to use "Method 3: Application-wide Catch-all with error_response"
Then, I wrote the following code in my controller:

def handle_error():
    cherrypy.response.status = 500
cherrypy.response.body = ["<html><body>Sorry, a Server Internal Error 500 occured</body></html>"] #sendMail('[email protected]', 'Error in your web app', _cperror.format_exc())

def error_page(status, message, traceback, version):
    return "Sorry, an error occured!"

class Root:
    _cp_config = {
            'error_page.default': error_page,
            'request.error_response': handle_error
            }


I tested a 404 error and it works, in fact it shows me the message: "Sorry, an error occurred!"
as defined in error_page() function.

I also simulated a 500 error (forcing a raise SyntaxError in the controller)
and I was expecting that handle_error() functionshows me the message:
"Sorry, a 500 Server Internal Error occured".
Instead I get always the python traceback.

My prod.cfg has:

error_catcher.on=True
environment="production"

I can't realize what's wrong.
I would be glad if someone could help me.

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.

Reply via email to