module documentation

Our exception hierarchy:

  • HTTPError x RequestError

    • TransportError - TimeoutException

      · ConnectTimeout · ReadTimeout · WriteTimeout · PoolTimeout

      • NetworkError · ConnectError · ReadError · WriteError · CloseError
      • ProtocolError · LocalProtocolError · RemoteProtocolError
      • ProxyError
      • UnsupportedProtocol
    • DecodingError

    • TooManyRedirects

    • RequestBodyUnavailable

    x HTTPStatusError

  • InvalidURL

  • CookieConflict

  • StreamError x StreamConsumed x StreamClosed x ResponseNotRead x RequestNotRead

Function request​_context A context manager that can be used to attach the given request context to any RequestError exceptions that are raised within the block.
@contextlib.contextmanager
def request_context(request=None):
A context manager that can be used to attach the given request context to any RequestError exceptions that are raised within the block.
Parameters
request:RequestUndocumented
Returns
typing.Iterator[None]Undocumented