Go to the latest version of this document.

# ``twisted`.`web`.`error`.`PageRedirect``

exception documentation

`class PageRedirect(Error): (source)`

Constructor: `PageRedirect(code, message, response, location)`

View In Hierarchy

A request resulted in an HTTP redirect.

Method | `__init__` | Initializes a page redirect exception.
Instance Variable | `location` | The location of the redirect which was not followed.
Instance Variable | `message` | Undocumented

Inherited from `Error`:

Method | `__str__` | Undocumented
Instance Variable | `response` | A complete HTML document for an error page.
Instance Variable | `status` | Refers to an HTTP status code, for example `http.NOT_FOUND`.

def __init__(self, code: `int | bytes`, message: `bytes | None` = None, response: `bytes | None` = None, location: `bytes | None` = None): (source)
overrides `twisted.web.error.Error.__init__`

Initializes a page redirect exception.

Parameters
code:`bytes` | Refers to an HTTP status code, for example `http.NOT_FOUND`. If no `message` is given, `code` is mapped to a descriptive string that is used instead.
message:`bytes` | A short error message, for example `b"NOT FOUND"`.
response:`bytes` | A complete HTML document for an error page.
location:`bytes` | The location response-header field value. It is an absolute URI used to redirect the receiver to a location other than the Request-URI so the request can be completed.

location: `bytes | None` = (source)

The location of the redirect which was not followed.

message = (source)
overrides `twisted.web.error.Error.message`

Undocumented