]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove support for the old get_error_html function.
authorBen Darnell <ben@bendarnell.com>
Sat, 21 Jun 2014 17:32:44 +0000 (13:32 -0400)
committerBen Darnell <ben@bendarnell.com>
Sat, 21 Jun 2014 17:32:44 +0000 (13:32 -0400)
docs/releases/next.rst
tornado/web.py

index 94a86166166e2393c308ea3cfdc900cc8f09583a..76cbe3c63d3e7d081370815e9700550de1891f01 100644 (file)
@@ -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
index d28531e225a94328b7d53489cda89822c0e59235..cd0232192934eb269912f5f957bb6a2a20453d08 100644 (file)
@@ -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')