
    Whu                        d Z ddlZddlZej        rddlmZm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 d- d.e          Z G d/ d0e          Z G d1 d2e          Z G d3 d4e          Z  G d5 d6e           Z! G d7 d8e           Z" G d9 d:e           Z# G d; d<e           Z$ej%        dAd=d>d?ej&        d         fd@            Z'dS )Bu  
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
    N   )RequestResponsec                   ,     e Zd ZdZdeddf fdZ xZS )	HTTPErrora  
    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                 J    t                                          |           d S Nsuper__init__selfr   	__class__s     W/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/httpx/_exceptions.pyr   zHTTPError.__init__;   !    !!!!!    __name__
__module____qualname____doc__strr   __classcell__r   s   @r   r   r   )   sU         "" " " " " " " " " " " "r   r   c                   p     e Zd ZdZdddeddddf fdZedd	            Zej        dd
            Z xZ	S )RequestErrorzS
    Base class for all exceptions that may occur when issuing a `.request()`.
    N)requestr   r   r   r	   c                X    t                                          |           || _        d S r   )r   r   _request)r   r   r   r   s      r   r   zRequestError.__init__D   s(    !!!  r   c                 <    | j         t          d          | j         S )Nz'The .request property has not been set.)r!   RuntimeError)r   s    r   r   zRequestError.requestN   s!    = HIII}r   c                     || _         d S r   )r!   )r   r   s     r   r   zRequestError.requestT   s    r   )r	   r   )r   r   r	   N)
r   r   r   r   r   r   propertyr   setterr   r   s   @r   r   r   ?   s          >B          d                X
 ^      ^         r   r   c                       e Zd ZdZdS )TransportErrorzU
    Base class for all exceptions that occur at the level of the Transport API.
    Nr   r   r   r    r   r   r(   r(   Y              r   r(   c                       e Zd ZdZdS )TimeoutExceptionzM
    The base class for timeout errors.

    An operation has timed out.
    Nr)   r*   r   r   r-   r-   b              r   r-   c                       e Zd ZdZdS )ConnectTimeoutz1
    Timed out while connecting to the host.
    Nr)   r*   r   r   r0   r0   j   r+   r   r0   c                       e Zd ZdZdS )ReadTimeoutz7
    Timed out while receiving data from the host.
    Nr)   r*   r   r   r2   r2   p   r+   r   r2   c                       e Zd ZdZdS )WriteTimeoutz3
    Timed out while sending data to the host.
    Nr)   r*   r   r   r4   r4   v   r+   r   r4   c                       e Zd ZdZdS )PoolTimeoutzB
    Timed out waiting to acquire a connection from the pool.
    Nr)   r*   r   r   r6   r6   |   r+   r   r6   c                       e Zd ZdZdS )NetworkErrorzo
    The base class for network-related errors.

    An error occurred while interacting with the network.
    Nr)   r*   r   r   r8   r8      r.   r   r8   c                       e Zd ZdZdS )	ReadErrorz2
    Failed to receive data from the network.
    Nr)   r*   r   r   r:   r:      r+   r   r:   c                       e Zd ZdZdS )
WriteErrorz2
    Failed to send data through the network.
    Nr)   r*   r   r   r<   r<      r+   r   r<   c                       e Zd ZdZdS )ConnectErrorz+
    Failed to establish a connection.
    Nr)   r*   r   r   r>   r>      r+   r   r>   c                       e Zd ZdZdS )
CloseErrorz'
    Failed to close a connection.
    Nr)   r*   r   r   r@   r@      r+   r   r@   c                       e Zd ZdZdS )
ProxyErrorzB
    An error occurred while establishing a proxy connection.
    Nr)   r*   r   r   rB   rB      r+   r   rB   c                       e Zd ZdZdS )UnsupportedProtocolz
    Attempted to make a request to an unsupported protocol.

    For example issuing a request to `ftp://www.example.com`.
    Nr)   r*   r   r   rD   rD      r.   r   rD   c                       e Zd ZdZdS )ProtocolErrorz$
    The protocol was violated.
    Nr)   r*   r   r   rF   rF      r+   r   rF   c                       e Zd ZdZdS )LocalProtocolErrorz
    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   rH   rH      s           r   rH   c                       e Zd ZdZdS )RemoteProtocolErrorz_
    The protocol was violated by the server.

    For exaample, returning malformed HTTP.
    Nr)   r*   r   r   rJ   rJ      r.   r   rJ   c                       e Zd ZdZdS )DecodingErrorzG
    Decoding of the response failed, due to a malformed encoding.
    Nr)   r*   r   r   rL   rL      r+   r   rL   c                       e Zd ZdZdS )TooManyRedirectsz
    Too many redirects.
    Nr)   r*   r   r   rN   rN      r+   r   rN   c                   4     e Zd ZdZdeddddddf fd	Z xZS )
HTTPStatusErrorz|
    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                f    t                                          |           || _        || _        d S r   )r   r   r   rQ   )r   r   r   rQ   r   s       r   r   zHTTPStatusError.__init__   s/     	!!! r   r   r   s   @r   rP   rP      sg         !!(1!=G!	! ! ! ! ! ! ! ! ! !r   rP   c                   ,     e Zd ZdZdeddf fdZ xZS )
InvalidURLz7
    URL is improperly formed or cannot be parsed.
    r   r	   Nc                 J    t                                          |           d S r   r   r   s     r   r   zInvalidURL.__init__   r   r   r   r   s   @r   rT   rT      sU         " " " " " " " " " " " "r   rT   c                   ,     e Zd ZdZdeddf fdZ xZS )CookieConflictz
    Attempted to lookup a cookie by name, but multiple cookies existed.

    Can occur when calling `response.cookies.get(...)`.
    r   r	   Nc                 J    t                                          |           d S r   r   r   s     r   r   zCookieConflict.__init__   r   r   r   r   s   @r   rW   rW      sU         " " " " " " " " " " " "r   rW   c                   ,     e Zd ZdZdeddf fdZ xZS )StreamErrorz
    The base class for stream exceptions.

    The developer made an error in accessing the request stream in
    an invalid way.
    r   r	   Nc                 J    t                                          |           d S r   r   r   s     r   r   zStreamError.__init__  r   r   r   r   s   @r   rZ   rZ   	  sU         " " " " " " " " " " " "r   rZ   c                   $     e Zd ZdZd fdZ xZS )StreamConsumedz]
    Attempted to read or stream content, but the content has already
    been streamed.
    r	   Nc                 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.r   r   s     r   r   zStreamConsumed.__init__  s-    & 	 	!!!!!r   r	   Nr   r   r   r   r   r   r   s   @r   r]   r]     sG         
	" 	" 	" 	" 	" 	" 	" 	" 	" 	"r   r]   c                   $     e Zd ZdZd fdZ xZS )StreamClosedz\
    Attempted to read or stream response content, but the request has been
    closed.
    r	   Nc                 N    d}t                                          |           d S )NzDAttempted to read or stream content, but the stream has been closed.r   r   s     r   r   zStreamClosed.__init__-  s+    U 	 	!!!!!r   r_   r`   r   s   @r   rb   rb   '  sG         
" " " " " " " " " "r   rb   c                   $     e Zd ZdZd fdZ xZS )ResponseNotReadzY
    Attempted to access streaming response content, without having called `read()`.
    r	   Nc                 N    d}t                                          |           d S )NzOAttempted to access streaming response content, without having called `read()`.r   r   s     r   r   zResponseNotRead.__init__9  s&    c!!!!!r   r_   r`   r   s   @r   re   re   4  G         " " " " " " " " " "r   re   c                   $     e Zd ZdZd fdZ xZS )RequestNotReadzX
    Attempted to access streaming request content, without having called `read()`.
    r	   Nc                 N    d}t                                          |           d S )NzNAttempted to access streaming request content, without having called `read()`.r   r   s     r   r   zRequestNotRead.__init__C  s&    b!!!!!r   r_   r`   r   s   @r   ri   ri   >  rg   r   ri   r   r   r	   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_contextrm   H  sI         !CK	s   
 
$$r   )(r   
contextlibtypingTYPE_CHECKING_modelsr   r   	Exceptionr   r   r(   r-   r0   r2   r4   r6   r8   r:   r<   r>   r@   rB   rD   rF   rH   rJ   rL   rN   rP   rT   rW   r#   rZ   r]   rb   re   ri   contextmanagerIteratorrm   r*   r   r   <module>ru      s.     B     	 +********" " " " "	 " " ",         9      4    \       ~       %       "       #       "       >                     <                     .       N              -       L       |   ! ! ! ! !i ! ! !" " " " " " " "" " " " "Y " " ""	" 	" 	" 	" 	", 	" 	" 	"" " " " "[ " " "$
" 
" 
" 
" 
"; 
" 
" 
"" " " " "k " " "" " " " "[ " " " 
 
Y 
&/$2G 
 
 
 
 
 
r   