TurboGears / tg2

Python web framework with full-stack layer implemented on top of a microframework core with support for SQL DBMS, MongoDB and Pluggable Applications
http://www.turbogears.org/
Other
803 stars 77 forks source link

ErrorPageApplicationWrapper without TraceErrorsMiddleware will mute tracebacks #119

Open kiilerix opened 4 years ago

kiilerix commented 4 years ago

ErrorPageApplicationWrapper will (if enabled) catch application errors and (if handle_exceptions (which is default)) store them in backlash.exc_environ and backlash.exc_info where backlash TraceErrorsMiddleware can pick it up. It will catch and store no matter if backlash.TraceErrorsMiddleware actuallly is enabled. Disabling backlash with trace_errors.enable (which users might want for other reasons) will thus effectively hide application errors. That dependency will confusingly hide errors when they happen, and doesn't seem necessary.

I suggest to effectively let errorpage.handle_exceptions default to false if not using TraceErrorsMiddleware.

(In some ways it seems like it would be better have these two middlewares come in the opposite order.)