From 3d5c48f83131233cd273e46bc61e9fb7098c0493 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 21 Jun 2014 13:32:44 -0400 Subject: [PATCH] Remove support for the old get_error_html function. --- docs/releases/next.rst | 2 ++ tornado/web.py | 19 ------------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/docs/releases/next.rst b/docs/releases/next.rst index 94a86166..76cbe3c6 100644 --- a/docs/releases/next.rst +++ b/docs/releases/next.rst @@ -26,6 +26,8 @@ Backwards-compatibility notes time due to stack contexts (and more recently coroutines). * ``curl_httpclient`` now requires a minimum of libcurl version 7.21.1 and pycurl 7.18.2. +* Support for ``RequestHandler.get_error_html`` has been removed; + override `.RequestHandler.write_error` instead. Other notes diff --git a/tornado/web.py b/tornado/web.py index d28531e2..cd023219 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -943,26 +943,7 @@ class RequestHandler(object): ``kwargs["exc_info"]``. Note that this exception may not be the "current" exception for purposes of methods like ``sys.exc_info()`` or ``traceback.format_exc``. - - For historical reasons, if a method ``get_error_html`` exists, - it will be used instead of the default ``write_error`` implementation. - ``get_error_html`` returned a string instead of producing output - normally, and had different semantics for exception handling. - Users of ``get_error_html`` are encouraged to convert their code - to override ``write_error`` instead. """ - if hasattr(self, 'get_error_html'): - if 'exc_info' in kwargs: - exc_info = kwargs.pop('exc_info') - kwargs['exception'] = exc_info[1] - try: - # Put the traceback into sys.exc_info() - raise_exc_info(exc_info) - except Exception: - self.finish(self.get_error_html(status_code, **kwargs)) - else: - self.finish(self.get_error_html(status_code, **kwargs)) - return if self.settings.get("serve_traceback") and "exc_info" in kwargs: # in debug mode, try to send a traceback self.set_header('Content-Type', 'text/plain')