tornado.web.Finish Class Reference

Detailed Description

An exception that ends the request without producing an error response.

When `Finish` is raised in a `RequestHandler`, the request will end
(calling `RequestHandler.finish` if it hasn't already been called),
but the outgoing response will not be modified and the error-handling
methods (including `RequestHandler.write_error`) will not be called.

This can be a more convenient way to implement custom error pages
than overriding ``write_error`` (especially in library code)::

    if self.current_user is None:
        self.set_status(401)
        self.set_header('WWW-Authenticate', 'Basic realm="something"')
        raise Finish()

Definition at line 1959 of file web.py.


The documentation for this class was generated from the following file:


rosbridge_server
Author(s): Jonathan Mace
autogenerated on Wed Sep 13 2017 03:18:21