I'm using the latest version of Google App Engine, Python 2.7 and webapp2, but enabling debug mode just gives me a blank HTML page on error rather than displaying the error and stack trace. This does not seem like the expected behavior:
"When in debug mode, any exception that is now caught is raised and the stack trace is displayed to the client" http://webapp-improved.appspot.com/guide/app.html
Am I doing something wrong? If not, how can I print the stack trace using a custom error handler in webapp2?
Thanks.
EDIT: Here's an example app that reproduces the error:
app.yaml
application: testapp
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
libraries:
- name: jinja2
version: "2.6"
main.py
import webapp2
# Run application
app = webapp2.WSGIApplication([webapp2.Route('/', handler='handlers.IndexHandler')], debug=True)
Because there is no file called "handlers.py" containing IndexHandler, this app throws a 500 server error. But even though debug = True, the app just shows an empty page, and does not output the error and stack trace, except in the App Engine log.
I have not tried this on the production server.
Seems like this bug was fixed in the latest version of webapp2: http://code.google.com/p/webapp-improved/source/detail?r=da20281cbba3f593ca49667752c0a2395ea483c5
I guess the fix will be included in the App Engine SDK eventually.