From 1e4f323620659e4a77f032bfbc9680fb1d43197d Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 3 Jul 2011 10:53:03 -0700 Subject: [PATCH] Better handling of errors not generated by an exception; add to release notes --- tornado/web.py | 2 +- website/sphinx/releases/next.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index 629d8a5fa..d43697549 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -657,7 +657,7 @@ class RequestHandler(object): If this error was caused by an uncaught exception, the exception object can be found in kwargs e.g. kwargs['exception'] """ - if self.settings.get("debug"): + if self.settings.get("debug") and "exception" in kwargs: # in debug mode, try to send a traceback self.set_header('Content-Type', 'text/plain') return traceback.format_exc() diff --git a/website/sphinx/releases/next.rst b/website/sphinx/releases/next.rst index 54ed8ede6..f9d56abaa 100644 --- a/website/sphinx/releases/next.rst +++ b/website/sphinx/releases/next.rst @@ -10,6 +10,9 @@ Backwards-incompatible changes * Support for secure cookies written by pre-1.0 releases of Tornado has been removed. The `RequestHandler.get_secure_cookie` method no longer takes an ``include_name`` parameter. +* The ``debug`` application setting now causes stack traces to be displayed + in the browser on uncaught exceptions. Since this may leak sensitive + information, debug mode is not recommended for public-facing servers. New features ~~~~~~~~~~~~ -- 2.47.3