MCPcopy Create free account
hub / github.com/EasyIME/PIME / Finish

Class Finish

python/python3/tornado/web.py:2416–2441  ·  view source on GitHub ↗

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 error-handling methods (including `RequestHandler.write_error`) wil

Source from the content-addressed store, hash-verified

2414
2415
2416class Finish(Exception):
2417 """An exception that ends the request without producing an error response.
2418
2419 When `Finish` is raised in a `RequestHandler`, the request will
2420 end (calling `RequestHandler.finish` if it hasn't already been
2421 called), but the error-handling methods (including
2422 `RequestHandler.write_error`) will not be called.
2423
2424 If `Finish()` was created with no arguments, the pending response
2425 will be sent as-is. If `Finish()` was given an argument, that
2426 argument will be passed to `RequestHandler.finish()`.
2427
2428 This can be a more convenient way to implement custom error pages
2429 than overriding ``write_error`` (especially in library code)::
2430
2431 if self.current_user is None:
2432 self.set_status(401)
2433 self.set_header('WWW-Authenticate', 'Basic realm="something"')
2434 raise Finish()
2435
2436 .. versionchanged:: 4.3
2437 Arguments passed to ``Finish()`` will be passed on to
2438 `RequestHandler.finish`.
2439 """
2440
2441 pass
2442
2443
2444class MissingArgumentError(HTTPError):

Callers 1

getMethod · 0.90

Calls

no outgoing calls

Tested by 1

getMethod · 0.72