HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/httpx/__pycache__/_exceptions.cpython-310.pyc
o

���gO!�@sdZddlmZddlZddlZejrddlmZmZgd�Z	Gdd�de
�ZGd	d
�d
e�ZGdd�de�Z
Gd
d�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e
�ZGd#d$�d$e
�ZGd%d&�d&e
�ZGd'd(�d(e�ZGd)d*�d*e�ZGd+d,�d,e�ZGd-d.�d.e�ZGd/d0�d0e�ZGd1d2�d2e
�Z Gd3d4�d4e
�Z!Gd5d6�d6e"�Z#Gd7d8�d8e#�Z$Gd9d:�d:e#�Z%Gd;d<�d<e#�Z&Gd=d>�d>e#�Z'ej(	dEdFdCdD��Z)dS)Gul
Our exception hierarchy:

* HTTPError
  x RequestError
    + TransportError
      - TimeoutException
        · ConnectTimeout
        · ReadTimeout
        · WriteTimeout
        · PoolTimeout
      - NetworkError
        · ConnectError
        · ReadError
        · WriteError
        · CloseError
      - ProtocolError
        · LocalProtocolError
        · RemoteProtocolError
      - ProxyError
      - UnsupportedProtocol
    + DecodingError
    + TooManyRedirects
  x HTTPStatusError
* InvalidURL
* CookieConflict
* StreamError
  x StreamConsumed
  x StreamClosed
  x ResponseNotRead
  x RequestNotRead
�)�annotationsN�)�Request�Response)�
CloseError�ConnectError�ConnectTimeout�CookieConflict�
DecodingError�	HTTPError�HTTPStatusError�
InvalidURL�LocalProtocolError�NetworkError�PoolTimeout�
ProtocolError�
ProxyError�	ReadError�ReadTimeout�RemoteProtocolError�RequestError�RequestNotRead�ResponseNotRead�StreamClosed�StreamConsumed�StreamError�TimeoutException�TooManyRedirects�TransportError�UnsupportedProtocol�
WriteError�WriteTimeoutcs@eZdZdZd
�fdd�Zedd	d
��Zejddd
��Z�ZS)ra�
    Base class for `RequestError` and `HTTPStatusError`.

    Useful for `try...except` blocks when issuing a request,
    and then calling `.raise_for_status()`.

    For example:

    ```
    try:
        response = httpx.get("https://www.example.com")
        response.raise_for_status()
    except httpx.HTTPError as exc:
        print(f"HTTP Exception for {exc.request.url} - {exc}")
    ```
    �message�str�return�Nonecst��|�d|_dS�N��super�__init__�_request��selfr"��	__class__��</usr/local/lib/python3.10/dist-packages/httpx/_exceptions.pyr)\s
zHTTPError.__init__rcCs|jdur	td��|jS)Nz'The .request property has not been set.)r*�RuntimeError)r,r/r/r0�request`s
zHTTPError.requestr2cCs
||_dSr&)r*)r,r2r/r/r0r2fs
�r"r#r$r%)r$r)r2rr$r%)	�__name__�
__module__�__qualname__�__doc__r)�propertyr2�setter�
__classcell__r/r/r-r0rJsrcs(eZdZdZdd�d�fd
d�Z�ZS)
rzS
    Base class for all exceptions that may occur when issuing a `.request()`.
    N)r2r"r#r2�Request | Noner$r%cst��|�||_dSr&r')r,r"r2r-r/r0r)ps
zRequestError.__init__)r"r#r2r;r$r%�r4r5r6r7r)r:r/r/r-r0rksrc@�eZdZdZdS)rzU
    Base class for all exceptions that occur at the level of the Transport API.
    N�r4r5r6r7r/r/r/r0r{�rc@r=)rzM
    The base class for timeout errors.

    An operation has timed out.
    Nr>r/r/r/r0r�r?rc@r=)rz1
    Timed out while connecting to the host.
    Nr>r/r/r/r0r�r?rc@r=)rz7
    Timed out while receiving data from the host.
    Nr>r/r/r/r0r�r?rc@r=)r!z3
    Timed out while sending data to the host.
    Nr>r/r/r/r0r!�r?r!c@r=)rzB
    Timed out waiting to acquire a connection from the pool.
    Nr>r/r/r/r0r�r?rc@r=)rzo
    The base class for network-related errors.

    An error occurred while interacting with the network.
    Nr>r/r/r/r0r�r?rc@r=)rz2
    Failed to receive data from the network.
    Nr>r/r/r/r0r�r?rc@r=)r z2
    Failed to send data through the network.
    Nr>r/r/r/r0r �r?r c@r=)rz+
    Failed to establish a connection.
    Nr>r/r/r/r0r�r?rc@r=)rz'
    Failed to close a connection.
    Nr>r/r/r/r0r�r?rc@r=)rzB
    An error occurred while establishing a proxy connection.
    Nr>r/r/r/r0r�r?rc@r=)rz�
    Attempted to make a request to an unsupported protocol.

    For example issuing a request to `ftp://www.example.com`.
    Nr>r/r/r/r0r�r?rc@r=)rz$
    The protocol was violated.
    Nr>r/r/r/r0r�r?rc@r=)rz�
    A protocol was violated by the client.

    For example if the user instantiated a `Request` instance explicitly,
    failed to include the mandatory `Host:` header, and then issued it directly
    using `client.send()`.
    Nr>r/r/r/r0r�r?rc@r=)rz^
    The protocol was violated by the server.

    For example, returning malformed HTTP.
    Nr>r/r/r/r0r�r?rc@r=)r
zG
    Decoding of the response failed, due to a malformed encoding.
    Nr>r/r/r/r0r
�r?r
c@r=)rz
    Too many redirects.
    Nr>r/r/r/r0r�r?rcs"eZdZdZd�fd
d�Z�ZS)
rz|
    The response had an error HTTP status of 4xx or 5xx.

    May be raised when calling `response.raise_for_status()`
    r"r#r2r�responserr$r%cst��|�||_||_dSr&)r(r)r2r@)r,r"r2r@r-r/r0r)	s
zHTTPStatusError.__init__)r"r#r2rr@rr$r%r<r/r/r-r0r�rc�"eZdZdZd�fdd�Z�ZS)	r
z7
    URL is improperly formed or cannot be parsed.
    r"r#r$r%c�t��|�dSr&�r(r)r+r-r/r0r)�zInvalidURL.__init__r3r<r/r/r-r0r
�r
crB)	r	z�
    Attempted to lookup a cookie by name, but multiple cookies existed.

    Can occur when calling `response.cookies.get(...)`.
    r"r#r$r%crCr&rDr+r-r/r0r)rEzCookieConflict.__init__r3r<r/r/r-r0r	rAr	crB)	rz�
    The base class for stream exceptions.

    The developer made an error in accessing the request stream in
    an invalid way.
    r"r#r$r%crCr&rDr+r-r/r0r)1rEzStreamError.__init__r3r<r/r/r-r0r)src�"eZdZdZd�fdd�Z�ZS)rz]
    Attempted to read or stream content, but the content has already
    been streamed.
    r$r%c�d}t��|�dS)Na]Attempted to read or stream some content, but the content has already been streamed. For requests, this could be due to passing a generator as request content, and then receiving a redirect response or a secondary request as part of an authentication flow.For responses, this could be due to attempting to stream the response content more than once.rDr+r-r/r0r);s�zStreamConsumed.__init__�r$r%r<r/r/r-r0r5�rcrG)rz\
    Attempted to read or stream response content, but the request has been
    closed.
    r$r%crH)NzDAttempted to read or stream content, but the stream has been closed.rDr+r-r/r0r)Ms�zStreamClosed.__init__rIr<r/r/r-r0rGrJrcrG)rzY
    Attempted to access streaming response content, without having called `read()`.
    r$r%crH)NzOAttempted to access streaming response content, without having called `read()`.rDr+r-r/r0r)Y��zResponseNotRead.__init__rIr<r/r/r-r0rTrFrcrG)rzX
    Attempted to access streaming request content, without having called `read()`.
    r$r%crH)NzNAttempted to access streaming request content, without having called `read()`.rDr+r-r/r0r)frKzRequestNotRead.__init__rIr<r/r/r-r0rarFrr2r;r$�typing.Iterator[None]c
cs:�zdVWdSty}z	|dur||_|�d}~ww)z�
    A context manager that can be used to attach the given request context
    to any `RequestError` exceptions that are raised within the block.
    N)rr2)r2�excr/r/r0�request_contextns���rNr&)r2r;r$rL)*r7�
__future__r�
contextlib�typing�
TYPE_CHECKING�_modelsrr�__all__�	Exceptionrrrrrrr!rrrr rrrrrrrr
rrr
r	r1rrrrr�contextmanagerrNr/r/r/r0�<module>sL! !			
	
	


�