cherrypy.tutorial.tut10_http_errors module

Tutorial: HTTP errors.

HTTPError is used to return an error response to the client. CherryPy has lots of options regarding how such errors are logged, displayed, and formatted.

class cherrypy.tutorial.tut10_http_errors.HTTPErrorDemo[source]

Bases: object

HTTP error representation app.

_cp_config = {'error_page.403': '/home/docs/checkouts/readthedocs.org/user_builds/cherrypy/envs/latest/lib/python3.11/site-packages/cherrypy/tutorial/custom_error.html'}
error(code)[source]

Respond with a given HTTP error.

index()[source]

Produce HTTP response body of error display app index URI.

messageArg()[source]

Respond with an HTTP 500 and a custom message.

toggleTracebacks()[source]

Switch tracebacks setting on /toggleTracebacks URI.