TurboGears standard error handler WebError doesn't work well with mod_wsgi processes. sfpy has custom error catching middleware and error template to display a trace in the web browser. We should use that in Allura also. And potentially enable the WebError or wdb in Allura when it's run with paster, since that's an even better debugger.
Remove
processes
fromWSGIDaemonProcess
directive (can't even be set to 1).werkzeug
Comment out our
tg.error.ErrorHandler
middleware and putapp = DebuggedApplication(app, evalex=True, console_path='/nf/__console__')
afterStatusCodeRedirect
. Works well, but less is logged to stderr logs (no env vars) and c.app/project/user don't work in interactive debugging.Still works with multiprocess, including limited interactive debugging (but doesn't work completely)
weberror
set debug=true in
ini
fileRequires hacks to modify
/_debug
URL to be/nf/_debug
which is needed for our sandbox environment. c.app/project/user does still work.SSLMiddleware
interferes withErrorHandler
. PuttingErrorHandler
after it works, but then we'd miss some errors.I've forked WebError at https://github.com/brondsem/weberror to support /nf/_debug instead of /_debug but decided not to use that, since it's only needed for the SF sandbox environment and we can modify our routing.
sfpy:db/6093 - test with debug=false and ensure that /projects/ccaproj05/files/ shows a PFS error as flash message (that's the
safe_message_from_exception
functionality that we still keep around)