PyDocs

Internet Protocols and Support

urllib.error

Exception classes raised by urllib.

The base exception class is URLError, which inherits from OSError.  It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.

HTTPError is an exception class that is also a valid HTTP response
instance.  It behaves this way because HTTP protocol errors are valid
responses, with a status code, headers, and a body.  In some contexts,
an application may want to handle an exception like a regular
response.
Symbols in urllib.error

c

ContentTooShortError
Exception raised when downloaded size does not match content-length.

h

HTTPError
Raised when HTTP error occurs, but also acts like non-error return

u

URLError
The handlers raise this exception (or derived exceptions) when they run into a problem.