diff --git a/Doc/library/urllib.error.rst b/Doc/library/urllib.error.rst --- a/Doc/library/urllib.error.rst +++ b/Doc/library/urllib.error.rst @@ -29,16 +29,21 @@ The following exceptions are raised by : .. exception:: HTTPError Though being an exception (a subclass of :exc:`URLError`), an :exc:`HTTPError` can also function as a non-exceptional file-like return value (the same thing that :func:`urlopen` returns). This is useful when handling exotic HTTP errors, such as requests for authentication. + .. attribute:: reason + + The reason for this error. It can be a message string or another + exception instance. + .. attribute:: code An HTTP status code as defined in `RFC 2616 `_. This numeric value corresponds to a value found in the dictionary of codes as found in :attr:`http.server.BaseHTTPRequestHandler.responses`. .. exception:: ContentTooShortError(msg, content)