§
    ëXÊj™"  ã                  ó¨  — d Z ddlmZ ddlZddlZddlmZ ej        rddlm	Z	m
Z
 g d¢Z G d„ d	e¦  «        Z G d
„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d „ d!e¦  «        Z G d"„ d#e¦  «        Z G d$„ d%e¦  «        Z G d&„ d'e¦  «        Z G d(„ d)e¦  «        Z G d*„ d+e¦  «        Z G d,„ d-e¦  «        Z  G d.„ d/e¦  «        Z! G d0„ d1e¦  «        Z" G d2„ d3e¦  «        Z# G d4„ d5e¦  «        Z$ G d6„ d7e¦  «        Z% G d8„ d9e&¦  «        Z' G d:„ d;e'¦  «        Z( G d<„ d=e'¦  «        Z) G d>„ d?e'¦  «        Z* G d@„ dAe'¦  «        Z+ej,        dGdHdF„¦   «         Z-dS )Iul  
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)Ú	Generatoré   )Ú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ÚWriteTimeoutc                  ó   — e Zd ZdZdS )ÚHTTPXDeprecationWarninga_  A custom deprecation warning for HTTPX.

    Unlike the built-in `DeprecationWarning`, this inherits from `UserWarning` to ensure it is visible by default,
    helping users discover deprecated features without needing to enable warnings explicitly.

    Reference: https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úCC:\Projects\Historical\venv\Lib\site-packages\httpx2/_exceptions.pyr%   r%   K   ó   € € € € € ðð ð ð r,   r%   c                  ó^   ‡ — e Zd ZdZdˆ fd„Zedd„¦   «         Zej        dd
„¦   «         Zˆ xZS )r   a”  
    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 = httpx2.get("https://www.example.com")
        response.raise_for_status()
    except httpx2.HTTPError as exc:
        print(f"HTTP Exception for {exc.request.url} - {exc}")
    ```
    ÚmessageÚstrÚreturnÚNonec                óX   •— t          ¦   «                              |¦  «         d | _        d S ©N©ÚsuperÚ__init__Ú_request©Úselfr0   Ú	__class__s     €r-   r8   zHTTPError.__init__g   s&   ø€ Ý‰Œ×Ò˜Ñ!Ô!Ð!Ø(,ˆŒˆˆr,   r   c                ó<   — | j         €t          d¦  «        ‚| j         S )Nz'The .request property has not been set.)r9   ÚRuntimeError)r;   s    r-   ÚrequestzHTTPError.requestk   s!   € àŒ=Ð ÝÐHÑIÔIÐIØŒ}Ðr,   r?   c                ó   — || _         d S r5   )r9   )r;   r?   s     r-   r?   zHTTPError.requestq   s   € àˆŒˆˆr,   ©r0   r1   r2   r3   )r2   r   )r?   r   r2   r3   )	r'   r(   r)   r*   r8   Úpropertyr?   ÚsetterÚ__classcell__©r<   s   @r-   r   r   U   s‰   ø€ € € € € ðð ð"-ð -ð -ð -ð -ð -ð ðð ð ñ „Xðð
 „^ð ð  ð  ñ „^ð ð  ð  ð  ð  r,   r   c                  ó*   ‡ — e Zd ZdZddœdˆ fd
„Zˆ xZS )r   zS
    Base class for all exceptions that may occur when issuing a `.request()`.
    N)r?   r0   r1   r?   úRequest | Noner2   r3   c               óX   •— t          ¦   «                              |¦  «         || _        d S r5   r6   )r;   r0   r?   r<   s      €r-   r8   zRequestError.__init__{   s(   ø€ Ý‰Œ×Ò˜Ñ!Ô!Ð!ð  ˆŒˆˆr,   )r0   r1   r?   rG   r2   r3   ©r'   r(   r)   r*   r8   rD   rE   s   @r-   r   r   v   sX   ø€ € € € € ðð ð CGð  ð  ð  ð  ð  ð  ð  ð  ð  ð  ð  ð  r,   r   c                  ó   — e Zd ZdZdS )r    zU
    Base class for all exceptions that occur at the level of the Transport API.
    Nr&   r+   r,   r-   r    r    †   ó   € € € € € ðð ð ð r,   r    c                  ó   — e Zd ZdZdS )r   zM
    The base class for timeout errors.

    An operation has timed out.
    Nr&   r+   r,   r-   r   r   �   ó   € € € € € ðð ð ð r,   r   c                  ó   — e Zd ZdZdS )r
   z1
    Timed out while connecting to the host.
    Nr&   r+   r,   r-   r
   r
   —   rK   r,   r
   c                  ó   — e Zd ZdZdS )r   z7
    Timed out while receiving data from the host.
    Nr&   r+   r,   r-   r   r   �   rK   r,   r   c                  ó   — e Zd ZdZdS )r#   z3
    Timed out while sending data to the host.
    Nr&   r+   r,   r-   r#   r#   £   rK   r,   r#   c                  ó   — e Zd ZdZdS )r   zB
    Timed out waiting to acquire a connection from the pool.
    Nr&   r+   r,   r-   r   r   ©   rK   r,   r   c                  ó   — e Zd ZdZdS )r   zo
    The base class for network-related errors.

    An error occurred while interacting with the network.
    Nr&   r+   r,   r-   r   r   ²   rM   r,   r   c                  ó   — e Zd ZdZdS )r   z2
    Failed to receive data from the network.
    Nr&   r+   r,   r-   r   r   º   rK   r,   r   c                  ó   — e Zd ZdZdS )r"   z2
    Failed to send data through the network.
    Nr&   r+   r,   r-   r"   r"   À   rK   r,   r"   c                  ó   — e Zd ZdZdS )r	   z+
    Failed to establish a connection.
    Nr&   r+   r,   r-   r	   r	   Æ   rK   r,   r	   c                  ó   — e Zd ZdZdS )r   z'
    Failed to close a connection.
    Nr&   r+   r,   r-   r   r   Ì   rK   r,   r   c                  ó   — e Zd ZdZdS )r   zB
    An error occurred while establishing a proxy connection.
    Nr&   r+   r,   r-   r   r   Õ   rK   r,   r   c                  ó   — e Zd ZdZdS )r!   z€
    Attempted to make a request to an unsupported protocol.

    For example issuing a request to `ftp://www.example.com`.
    Nr&   r+   r,   r-   r!   r!   Û   rM   r,   r!   c                  ó   — e Zd ZdZdS )r   z$
    The protocol was violated.
    Nr&   r+   r,   r-   r   r   ã   rK   r,   r   c                  ó   — e Zd ZdZdS )r   zæ
    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-   r   r   é   r.   r,   r   c                  ó   — e Zd ZdZdS )r   z^
    The protocol was violated by the server.

    For example, returning malformed HTTP.
    Nr&   r+   r,   r-   r   r   ó   rM   r,   r   c                  ó   — e Zd ZdZdS )r   zG
    Decoding of the response failed, due to a malformed encoding.
    Nr&   r+   r,   r-   r   r   þ   rK   r,   r   c                  ó   — e Zd ZdZdS )r   z
    Too many redirects.
    Nr&   r+   r,   r-   r   r     rK   r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd
„Zˆ xZS )r   z|
    The response had an error HTTP status of 4xx or 5xx.

    May be raised when calling `response.raise_for_status()`
    r0   r1   r?   r   Úresponser   r2   r3   c               óf   •— t          ¦   «                              |¦  «         || _        || _        d S r5   )r7   r8   r?   r_   )r;   r0   r?   r_   r<   s       €r-   r8   zHTTPStatusError.__init__  s-   ø€ Ý‰Œ×Ò˜Ñ!Ô!Ð!ØˆŒØ ˆŒˆˆr,   )r0   r1   r?   r   r_   r   r2   r3   rI   rE   s   @r-   r   r     sG   ø€ € € € € ðð ð!ð !ð !ð !ð !ð !ð !ð !ð !ð !r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z7
    URL is improperly formed or cannot be parsed.
    r0   r1   r2   r3   c                óJ   •— t          ¦   «                              |¦  «         d S r5   ©r7   r8   r:   s     €r-   r8   zInvalidURL.__init__  ó!   ø€ Ý‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!r,   rA   rI   rE   s   @r-   r   r     sG   ø€ € € € € ðð ð"ð "ð "ð "ð "ð "ð "ð "ð "ð "r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z†
    Attempted to lookup a cookie by name, but multiple cookies existed.

    Can occur when calling `response.cookies.get(...)`.
    r0   r1   r2   r3   c                óJ   •— t          ¦   «                              |¦  «         d S r5   rc   r:   s     €r-   r8   zCookieConflict.__init__*  rd   r,   rA   rI   rE   s   @r-   r   r   #  sG   ø€ € € € € ðð ð"ð "ð "ð "ð "ð "ð "ð "ð "ð "r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z‡
    The base class for stream exceptions.

    The developer made an error in accessing the request stream in
    an invalid way.
    r0   r1   r2   r3   c                óJ   •— t          ¦   «                              |¦  «         d S r5   rc   r:   s     €r-   r8   zStreamError.__init__<  rd   r,   rA   rI   rE   s   @r-   r   r   4  sG   ø€ € € € € ðð ð"ð "ð "ð "ð "ð "ð "ð "ð "ð "r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z]
    Attempted to read or stream content, but the content has already
    been streamed.
    r2   r3   c                óN   •— d}t          ¦   «                              |¦  «         d S )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.rc   r:   s     €r-   r8   zStreamConsumed.__init__F  s-   ø€ ð&ð 	õ 	‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!r,   ©r2   r3   rI   rE   s   @r-   r   r   @  sG   ø€ € € € € ðð ð
	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z\
    Attempted to read or stream response content, but the request has been
    closed.
    r2   r3   c                óN   •— d}t          ¦   «                              |¦  «         d S )NzDAttempted to read or stream content, but the stream has been closed.rc   r:   s     €r-   r8   zStreamClosed.__init__X  s&   ø€ ØXˆÝ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!r,   rk   rI   rE   s   @r-   r   r   R  sG   ø€ € € € € ðð ð
"ð "ð "ð "ð "ð "ð "ð "ð "ð "r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   zY
    Attempted to access streaming response content, without having called `read()`.
    r2   r3   c                óN   •— d}t          ¦   «                              |¦  «         d S )NzOAttempted to access streaming response content, without having called `read()`.rc   r:   s     €r-   r8   zResponseNotRead.__init__b  s&   ø€ ØcˆÝ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!r,   rk   rI   rE   s   @r-   r   r   ]  óG   ø€ € € € € ðð ð"ð "ð "ð "ð "ð "ð "ð "ð "ð "r,   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   zX
    Attempted to access streaming request content, without having called `read()`.
    r2   r3   c                óN   •— d}t          ¦   «                              |¦  «         d S )NzNAttempted to access streaming request content, without having called `read()`.rc   r:   s     €r-   r8   zRequestNotRead.__init__l  s&   ø€ ØbˆÝ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!r,   rk   rI   rE   s   @r-   r   r   g  rp   r,   r   r?   rG   r2   úGenerator[None]c              #  óN   K  — 	 dV — dS # t           $ r}| �| |_        |‚d}~ww xY w)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)r   r?   )r?   Úexcs     r-   Úrequest_contextrv   q  sI   è è € ðØˆˆˆˆˆøÝð ð ð ØÐØ!ˆCŒKØˆ	øøøøðøøøs   „
 Š
$”Ÿ$r5   )r?   rG   r2   rs   ).r*   Ú
__future__r   Ú
contextlibÚtypingÚcollections.abcr   ÚTYPE_CHECKINGÚ_modelsr   r   Ú__all__ÚUserWarningr%   Ú	Exceptionr   r   r    r   r
   r   r#   r   r   r   r"   r	   r   r   r!   r   r   r   r   r   r   r   r   r>   r   r   r   r   r   Úcontextmanagerrv   r+   r,   r-   ú<module>r�      sz  ððð ðB #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø €€€Ø %Ð %Ð %Ð %Ð %Ð %à	Ôð +Ø*Ð*Ð*Ð*Ð*Ð*Ð*Ð*ðð ð €ð@ð ð ð ð ˜kñ ô ð ð ð  ð  ð  ð  �	ñ  ô  ð  ðB ð  ð  ð  ð  �9ñ  ô  ð  ð ð ð ð ð �\ñ ô ð ðð ð ð ð �~ñ ô ð ðð ð ð ð Ð%ñ ô ð ðð ð ð ð Ð"ñ ô ð ðð ð ð ð Ð#ñ ô ð ðð ð ð ð Ð"ñ ô ð ðð ð ð ð �>ñ ô ð ðð ð ð ð �ñ ô ð ðð ð ð ð �ñ ô ð ðð ð ð ð �<ñ ô ð ðð ð ð ð �ñ ô ð ðð ð ð ð �ñ ô ð ðð ð ð ð ˜.ñ ô ð ðð ð ð ð �Nñ ô ð ðð ð ð ð ˜ñ ô ð ðð ð ð ð ˜-ñ ô ð ðð ð ð ð �Lñ ô ð ðð ð ð ð �|ñ ô ð ð
!ð 
!ð 
!ð 
!ð 
!�iñ 
!ô 
!ð 
!ð"ð "ð "ð "ð "�ñ "ô "ð "ð"ð "ð "ð "ð "�Yñ "ô "ð "ð"	"ð 	"ð 	"ð 	"ð 	"�,ñ 	"ô 	"ð 	"ð"ð "ð "ð "ð "�[ñ "ô "ð "ð$"ð "ð "ð "ð "�;ñ "ô "ð "ð"ð "ð "ð "ð "�kñ "ô "ð "ð"ð "ð "ð "ð "�[ñ "ô "ð "ð Ôð
ð 
ð 
ð 
ñ Ôð
ð 
ð 
r,   