views:

35

answers:

2

I am using the Bottle framework. I have set the @error decorator so I am able to display my customized error page, and i can also send email if any 500 error occurs, but I need the complete traceback to be sent in the email. Does anyone know how to have the framework include that in the e-mail?

A: 

Debugging mode enables full tracebacks:

from bottle import debug
debug(True)

From there, you will need to pipe stderr to a file, then send it.

Tim McNamara
The accepted answer here is much better: http://stackoverflow.com/questions/3324743/emailing-admin-when-a-500-error-occurs
Tim McNamara
Hi Tim, Thanks for the reply, i have done the debug(True), i am able to get the 500 error with traceback on my browser, how can i pipe the stderr to a file, can you show some example.
Suhail
Hey tim, thanks for the help, i got the solution, in the error500 function written after the @error decorator to serve my customized error page, wrote error.exception and error.traceback, these two give you the exception and complete traceback of the error message, i took help from Marcel the creator of Bottle Framework and he showed me the solution.
Suhail
Happy to help. Am glad things are working forr you.
Tim McNamara
A: 

in the error500 function written after the @error decorator to serve my customized error page, wrote error.exception and error.traceback, these two give the exception and complete traceback of the error message.

Suhail