
    Ii                        S r SSKrSSKr\R                  (       a  SSKJrJr   " S S\5      r " S S\5      r	 " S	 S
\	5      r
 " S S\
5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\
5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \
5      r " S! S"\
5      r " S# S$\
5      r " S% S&\5      r " S' S(\5      r " S) S*\	5      r " S+ S,\	5      r " S- S.\5      r " S/ S0\5      r " S1 S2\5      r " S3 S4\5      r  " S5 S6\ 5      r! " S7 S8\ 5      r" " S9 S:\ 5      r# " S; S<\ 5      r$\RJ                   SAS=\RL                  S>   S?\RN                  S   4S@ jj5       r(g)Bul  
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
    N   )RequestResponsec                   t   ^  \ rS rSrSrS\SS4U 4S jjr\S
S j5       r\R                  SS j5       rS	r
U =r$ )	HTTPError(   ab  
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returnNc                 2   > [         TU ]  U5        S U l        g Nsuper__init___requestselfr	   	__class__s     7/venv/lib/python3.13/site-packages/httpx/_exceptions.pyr   HTTPError.__init__:   s    !48    c                 J    U R                   c  [        S5      eU R                   $ )Nz'The .request property has not been set.)r   RuntimeError)r   s    r   requestHTTPError.request>   s"    == HII}}r   c                     Xl         g r   r   )r   r   s     r   r   r   D   s    r   r   )r
   r   )r   r   r
   N)__name__
__module____qualname____firstlineno____doc__strr   propertyr   setter__static_attributes____classcell__r   s   @r   r   r   (   sG    "9 9 9  
 ^^   r   r   c                   ^   ^  \ rS rSrSrSS.S\S\R                  S   SS4U 4S	 jjjrS
r	U =r
$ )RequestErrorI   zK
Base class for all exceptions that may occur when issuing a `.request()`.
N)r   r	   r   r   r
   c                0   > [         TU ]  U5        X l        g r   r   )r   r	   r   r   s      r   r   RequestError.__init__N   s     	!  r   r   )r   r   r   r    r!   r"   typingOptionalr   r%   r&   r'   s   @r   r)   r)   I   s:    
 FJ
 
 (.	(B
 	
  
 r   r)   c                       \ rS rSrSrSrg)TransportError[   zM
Base class for all exceptions that occur at the level of the Transport API.
 Nr   r   r   r    r!   r%   r2   r   r   r0   r0   [       r   r0   c                       \ rS rSrSrSrg)TimeoutExceptiond   zA
The base class for timeout errors.

An operation has timed out.
r2   Nr3   r2   r   r   r6   r6   d       r   r6   c                       \ rS rSrSrSrg)ConnectTimeoutl   z)
Timed out while connecting to the host.
r2   Nr3   r2   r   r   r:   r:   l   r4   r   r:   c                       \ rS rSrSrSrg)ReadTimeoutr   z/
Timed out while receiving data from the host.
r2   Nr3   r2   r   r   r=   r=   r   r4   r   r=   c                       \ rS rSrSrSrg)WriteTimeoutx   z+
Timed out while sending data to the host.
r2   Nr3   r2   r   r   r@   r@   x   r4   r   r@   c                       \ rS rSrSrSrg)PoolTimeout~   z:
Timed out waiting to acquire a connection from the pool.
r2   Nr3   r2   r   r   rC   rC   ~   r4   r   rC   c                       \ rS rSrSrSrg)NetworkError   zc
The base class for network-related errors.

An error occurred while interacting with the network.
r2   Nr3   r2   r   r   rF   rF      r8   r   rF   c                       \ rS rSrSrSrg)	ReadError   z*
Failed to receive data from the network.
r2   Nr3   r2   r   r   rI   rI      r4   r   rI   c                       \ rS rSrSrSrg)
WriteError   z*
Failed to send data through the network.
r2   Nr3   r2   r   r   rL   rL      r4   r   rL   c                       \ rS rSrSrSrg)ConnectError   z#
Failed to establish a connection.
r2   Nr3   r2   r   r   rO   rO      r4   r   rO   c                       \ rS rSrSrSrg)
CloseError   z
Failed to close a connection.
r2   Nr3   r2   r   r   rR   rR      r4   r   rR   c                       \ rS rSrSrSrg)
ProxyError   z:
An error occurred while establishing a proxy connection.
r2   Nr3   r2   r   r   rU   rU      r4   r   rU   c                       \ rS rSrSrSrg)UnsupportedProtocol   zt
Attempted to make a request to an unsupported protocol.

For example issuing a request to `ftp://www.example.com`.
r2   Nr3   r2   r   r   rX   rX      r8   r   rX   c                       \ rS rSrSrSrg)ProtocolError   z
The protocol was violated.
r2   Nr3   r2   r   r   r[   r[      r4   r   r[   c                       \ rS rSrSrSrg)LocalProtocolError   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()`.
r2   Nr3   r2   r   r   r^   r^      s    r   r^   c                       \ rS rSrSrSrg)RemoteProtocolError   zR
The protocol was violated by the server.

For example, returning malformed HTTP.
r2   Nr3   r2   r   r   ra   ra      r8   r   ra   c                       \ rS rSrSrSrg)DecodingError   z?
Decoding of the response failed, due to a malformed encoding.
r2   Nr3   r2   r   r   rd   rd      r4   r   rd   c                       \ rS rSrSrSrg)TooManyRedirects   z
Too many redirects.
r2   Nr3   r2   r   r   rg   rg      r4   r   rg   c                   @   ^  \ rS rSrSrS\SSSSSS	4U 4S
 jjrSrU =r$ )HTTPStatusError   zp
The response had an error HTTP status of 4xx or 5xx.

May be raised when calling `response.raise_for_status()`
r	   r   r   responser   r
   Nc                <   > [         TU ]  U5        X l        X0l        g r   )r   r   r   rl   )r   r	   r   rl   r   s       r   r   HTTPStatusError.__init__   s     	! r   )r   rl   	r   r   r   r    r!   r"   r   r%   r&   r'   s   @r   rj   rj      s2    !!(1!=G!	! !r   rj   c                   8   ^  \ rS rSrSrS\SS4U 4S jjrSrU =r$ )
InvalidURL   z/
URL is improperly formed or cannot be parsed.
r	   r
   Nc                 $   > [         TU ]  U5        g r   r   r   r   s     r   r   InvalidURL.__init__       !r   r2   ro   r'   s   @r   rq   rq      s     " " " "r   rq   c                   8   ^  \ rS rSrSrS\SS4U 4S jjrSrU =r$ )CookieConflict   zz
Attempted to lookup a cookie by name, but multiple cookies existed.

Can occur when calling `response.cookies.get(...)`.
r	   r
   Nc                 $   > [         TU ]  U5        g r   rt   r   s     r   r   CookieConflict.__init__  rv   r   r2   ro   r'   s   @r   rx   rx      s     " " " "r   rx   c                   8   ^  \ rS rSrSrS\SS4U 4S jjrSrU =r$ )StreamErrori  zw
The base class for stream exceptions.

The developer made an error in accessing the request stream in
an invalid way.
r	   r
   Nc                 $   > [         TU ]  U5        g r   rt   r   s     r   r   StreamError.__init__  rv   r   r2   ro   r'   s   @r   r}   r}     s     " " " "r   r}   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )StreamConsumedi  zQ
Attempted to read or stream content, but the content has already
been streamed.
c                 (   > Sn[         TU ]  U5        g )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.rt   r   s     r   r   StreamConsumed.__init__  s    & 	 	!r   r2   r
   Nr   r   r   r    r!   r   r%   r&   r'   s   @r   r   r     s    
	" 	"r   r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )StreamClosedi)  zP
Attempted to read or stream response content, but the request has been
closed.
c                 (   > Sn[         TU ]  U5        g )NzDAttempted to read or stream content, but the stream has been closed.rt   r   s     r   r   StreamClosed.__init__/  s    U 	 	!r   r2   r   r   r'   s   @r   r   r   )  s    
" "r   r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )ResponseNotReadi6  zQ
Attempted to access streaming response content, without having called `read()`.
c                 (   > Sn[         TU ]  U5        g )NzOAttempted to access streaming response content, without having called `read()`.rt   r   s     r   r   ResponseNotRead.__init__;      / 	 	!r   r2   r   r   r'   s   @r   r   r   6      " "r   r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )RequestNotReadiC  zP
Attempted to access streaming request content, without having called `read()`.
c                 (   > Sn[         TU ]  U5        g )NzNAttempted to access streaming request content, without having called `read()`.rt   r   s     r   r   RequestNotRead.__init__H  r   r   r2   r   r   r'   s   @r   r   r   C  r   r   r   r   r   r
   c              #   P   #     Sv   g! [          a  nU b  Xl        UeSnAff = f7f)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_contextr   P  s,      !K	s   &	 &
##&r   ))r!   
contextlibr-   TYPE_CHECKING_modelsr   r   	Exceptionr   r)   r0   r6   r:   r=   r@   rC   rF   rI   rL   rO   rR   rU   rX   r[   r^   ra   rd   rg   rj   rq   rx   r   r}   r   r   r   r   contextmanagerr.   Iteratorr   r2   r   r   <module>r      s  @  	* 	  B 9  $\ ~ % " # " >   <   . N  - L | !i !" ""Y ""	", 	""[ "$
"; 
"
"k 
"
"[ 
" *.__Y'__T r   