From: Ben Darnell Date: Sat, 21 Jun 2014 17:32:44 +0000 (-0400) Subject: Remove support for the old get_error_html function. X-Git-Tag: v4.0.0b1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d5c48f83131233cd273e46bc61e9fb7098c0493;p=thirdparty%2Ftornado.git Remove support for the old get_error_html function. --- diff --git a/docs/releases/next.rst b/docs/releases/next.rst index 94a861661..76cbe3c63 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 d28531e22..cd0232192 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')