
    bf$                     h   d Z ddlZddlZddlmZmZmZmZmZ ddl	m
Z
 ddlmZ 	 ddlZej        Zn# e$ r dxZZY nw xY werddlmZmZmZmZ ndxZxZZ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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#ej%                  Z& G d% d&e#          Z' G d' d(e          Z( G d) d*ee)          Z* G d+ d,e           Z+e#ej,        fZ-e+ej,        fZ.ej/        fZ0e+ej/        fZ1n e2            Z-e+e)fZ. e2            Z0e+fZ1 G d- d.ge1R  Z3 G d/ d0ge.R  Z4dS )1zHTTP related errors.    N)TYPE_CHECKINGAnyOptionalTupleUnion   )RawResponseMessage)LooseHeaders)ClientResponseConnectionKeyFingerprintRequestInfo)ClientErrorClientConnectionErrorClientOSErrorClientConnectorErrorClientProxyConnectionErrorClientSSLErrorClientConnectorSSLErrorClientConnectorCertificateErrorServerConnectionErrorServerTimeoutErrorServerDisconnectedErrorServerFingerprintMismatchClientResponseErrorClientHttpProxyErrorWSServerHandshakeErrorContentTypeErrorClientPayloadError
InvalidURLc                       e Zd ZdZdS )r   z(Base class for client connection errors.N__name__
__module____qualname____doc__     S/var/www/html/Alfredo/env/lib/python3.11/site-packages/aiohttp/client_exceptions.pyr   r   -   s        2222r(   r   c                       e Zd ZdZddddddedeedf         dee         d	ee         d
e	dee
         ddfdZde	fdZde	fdZedefd            Zej        deddfd            ZdS )r   a  Base class for exceptions that occur after getting a response.

    request_info: An instance of RequestInfo.
    history: A sequence of responses, if redirects occurred.
    status: HTTP status code.
    message: Error message.
    headers: Response headers.
    N )codestatusmessageheadersrequest_infohistory.r,   r-   r.   r/   returnc                    || _         |-|t          d          t          j        dt          d           ||| _        n||| _        nd| _        || _        || _        || _        ||f| _	        d S )NzSBoth code and status arguments are provided; code is deprecated, use status insteadz/code argument is deprecated, use status instead   
stacklevelr   )
r0   
ValueErrorwarningswarnDeprecationWarningr-   r.   r/   r1   args)selfr0   r1   r,   r-   r.   r/   s          r)   __init__zClientResponseError.__init__;   s     )! =   MA"   
  DKKDKKDK!7+			r(   c                 X    d                     | j        | j        | j        j                  S )Nz{}, message={!r}, url={!r})formatr-   r.   r0   real_urlr<   s    r)   __str__zClientResponseError.__str__\   s-    +22KL&
 
 	
r(   c                     | j         d| j        }| j        dk    r|d| j        z  }| j        dk    r|d| j        z  }| j        |d| j        z  }t          |           j         d| dS )	Nz, r   z	, status=r+   z
, message=z
, headers=())r0   r1   r-   r.   r/   typer#   )r<   r;   s     r)   __repr__zClientResponseError.__repr__c   s    #9999;!////D<21111D<#1111Dt**%//////r(   c                 H    t          j        dt          d           | j        S Nz/code property is deprecated, use status insteadr4   r5   r8   r9   r:   r-   rA   s    r)   r,   zClientResponseError.codem   s.    =	
 	
 	
 	

 {r(   valuec                 L    t          j        dt          d           || _        d S rI   rJ   )r<   rK   s     r)   r,   zClientResponseError.codev   s1    =	
 	
 	
 	

 r(   )r#   r$   r%   r&   r   r   r   r   intstrr
   r=   rB   rG   propertyr,   setterr'   r(   r)   r   r   1   s3         # $*., , ,!, ~s*+,
 sm, , , ,', 
, , , ,B
 
 
 
 
0# 0 0 0 0 c    X 
[# $    [  r(   r   c                       e Zd ZdZdS )r   zContentType found is not valid.Nr"   r'   r(   r)   r   r      s        ))))r(   r   c                       e Zd ZdZdS )r   z!websocket server handshake error.Nr"   r'   r(   r)   r   r      s        ++++r(   r   c                       e Zd ZdZdS )r   zHTTP proxy error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
    proxy responds with status other than ``200 OK``
    on ``CONNECT`` request.
    Nr"   r'   r(   r)   r   r      s           r(   r   c                       e Zd ZdZdS )TooManyRedirectsz%Client was redirected too many times.Nr"   r'   r(   r)   rU   rU      s        ////r(   rU   c                       e Zd ZdZdS )r   z$Base class for client socket errors.Nr"   r'   r(   r)   r   r      s        ....r(   r   c                       e Zd ZdZdS )r   zOSError error.Nr"   r'   r(   r)   r   r      s        r(   r   c                        e Zd ZdZdededdf fdZedefd            Zede	fd            Z
edee         fd	            Zedeeed
f         fd            Zde	fdZej        Z xZS )r   zClient connector error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        a connection can not be established.
    connection_keyos_errorr2   Nc                     || _         || _        t                                          |j        |j                   ||f| _        d S N)	_conn_key	_os_errorsuperr=   errnostrerrorr;   )r<   rY   rZ   	__class__s      r)   r=   zClientConnectorError.__init__   s@    '!):;;;#X.			r(   c                     | j         S r\   )r^   rA   s    r)   rZ   zClientConnectorError.os_error   s
    ~r(   c                     | j         j        S r\   r]   hostrA   s    r)   rf   zClientConnectorError.host       ~""r(   c                     | j         j        S r\   r]   portrA   s    r)   rj   zClientConnectorError.port   rg   r(   r   c                     | j         j        S r\   )r]   sslrA   s    r)   rl   zClientConnectorError.ssl   s    ~!!r(   c                 Z    d                     | | j        du rdn| j        | j                  S )Nz6Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]Tdefaultr?   rl   ra   rA   s    r)   rB   zClientConnectorError.__str__   s5    GNNtx4//))TXt}
 
 	
r(   )r#   r$   r%   r&   r   OSErrorr=   rO   rZ   rN   rf   r   rM   rj   r   
SSLContextboolrl   rB   BaseException
__reduce____classcell__rb   s   @r)   r   r      s!        /} / /D / / / / / / '    X #c # # # X# #hsm # # # X# "U:t]:; " " " X"
 
 
 
 
 )JJJJJr(   r   c                       e Zd ZdZdS )r   zProxy connection error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        connection to proxy can not be established.
    Nr"   r'   r(   r)   r   r      s           r(   r   c                   \     e Zd ZdZdedededdf fdZedefd            Z	defd	Z
 xZS )
UnixClientConnectorErrorzUnix connector error.

    Raised in :py:class:`aiohttp.connector.UnixConnector`
    if connection to unix socket can not be established.
    pathrY   rZ   r2   Nc                 Z    || _         t                                          ||           d S r\   )_pathr_   r=   )r<   rz   rY   rZ   rb   s       r)   r=   z!UnixClientConnectorError.__init__   s,     
22222r(   c                     | j         S r\   )r|   rA   s    r)   rz   zUnixClientConnectorError.path   s
    zr(   c                 Z    d                     | | j        du rdn| j        | j                  S )Nz4Cannot connect to unix socket {0.path} ssl:{1} [{2}]Trn   ro   rA   s    r)   rB   z UnixClientConnectorError.__str__   s5    ELLtx4//))TXt}
 
 	
r(   )r#   r$   r%   r&   rN   r   rp   r=   rO   rz   rB   ru   rv   s   @r)   ry   ry      s         33)63BI3	3 3 3 3 3 3 c    X
 
 
 
 
 
 
 
 
r(   ry   c                       e Zd ZdZdS )r   zServer connection errors.Nr"   r'   r(   r)   r   r      s        ####r(   r   c                   6    e Zd ZdZddeeedf         ddfdZdS )r   zServer disconnected.Nr.   r2   c                 ,    |d}|f| _         || _        d S )NzServer disconnected)r;   r.   )r<   r.   s     r)   r=   z ServerDisconnectedError.__init__   s     ?+GJ	r(   r\   )r#   r$   r%   r&   r   r	   rN   r=   r'   r(   r)   r   r      sO         &8#t&C D PT      r(   r   c                       e Zd ZdZdS )r   zServer timeout error.Nr"   r'   r(   r)   r   r      s        r(   r   c            
       :    e Zd ZdZdededededdf
dZdefd	ZdS )
r   z4SSL certificate does not match expected fingerprint.expectedgotrf   rj   r2   Nc                 T    || _         || _        || _        || _        ||||f| _        d S r\   )r   r   rf   rj   r;   )r<   r   r   rf   rj   s        r)   r=   z"ServerFingerprintMismatch.__init__   s2     		sD$/			r(   c                 p    d                     | j        j        | j        | j        | j        | j                  S )Nz/<{} expected={!r} got={!r} host={!r} port={!r}>)r?   rb   r#   r   r   rf   rj   rA   s    r)   rG   z"ServerFingerprintMismatch.__repr__   s2    @GGN#T]DHdi
 
 	
r(   )	r#   r$   r%   r&   bytesrN   rM   r=   rG   r'   r(   r)   r   r      sl        >>0 0U 0# 0S 0T 0 0 0 0
# 
 
 
 
 
 
r(   r   c                       e Zd ZdZdS )r   zResponse payload error.Nr"   r'   r(   r)   r   r     s        !!!!r(   r   c                   T     e Zd ZdZdeddf fdZedefd            ZdefdZ	 xZ
S )r    zbInvalid URL.

    URL used for fetching is malformed, e.g. it doesn't contains host
    part.
    urlr2   Nc                 J    t                                          |           d S r\   )r_   r=   )r<   r   rb   s     r)   r=   zInvalidURL.__init__  s#     	r(   c                     | j         d         S )Nr   )r;   rA   s    r)   r   zInvalidURL.url  s    y|r(   c                 2    d| j         j         d| j         dS )N< >)rb   r#   r   rA   s    r)   rG   zInvalidURL.__repr__  s"    84>*88TX8888r(   )r#   r$   r%   r&   r   r=   rO   r   rN   rG   ru   rv   s   @r)   r    r    	  s         C D      
 S    X9# 9 9 9 9 9 9 9 9r(   r    c                       e Zd ZdZdS )r   zBase error for ssl.*Errors.Nr"   r'   r(   r)   r   r     s        %%%%r(   r   c                       e Zd ZdZdS )r   zResponse ssl error.Nr"   r'   r(   r)   r   r   7  s        r(   r   c                       e Zd ZdZdededdfdZedefd            Zede	fd            Z
edee         fd	            Zedefd
            Zde	fdZdS )r   zResponse certificate error.rY   certificate_errorr2   Nc                 4    || _         || _        ||f| _        d S r\   )r]   _certificate_errorr;   )r<   rY   r   s      r)   r=   z(ClientConnectorCertificateError.__init__>  s$     ("3#%67			r(   c                     | j         S r\   )r   rA   s    r)   r   z1ClientConnectorCertificateError.certificate_errorE  s    &&r(   c                     | j         j        S r\   re   rA   s    r)   rf   z$ClientConnectorCertificateError.hostI  rg   r(   c                     | j         j        S r\   ri   rA   s    r)   rj   z$ClientConnectorCertificateError.portM  rg   r(   c                     | j         j        S r\   )r]   is_sslrA   s    r)   rl   z#ClientConnectorCertificateError.sslQ  s    ~$$r(   c                 ,    d                     |           S )Nz{Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} [{0.certificate_error.__class__.__name__}: {0.certificate_error.args}])r?   rA   s    r)   rB   z'ClientConnectorCertificateError.__str__U  s    **0&,,	
r(   )r#   r$   r%   r&   r   	Exceptionr=   rO   r   rN   rf   r   rM   rj   rr   rl   rB   r'   r(   r)   r   r   ;  s       %%8+8@I8	8 8 8 8 '9 ' ' ' X' #c # # # X# #hsm # # # X# %T % % % X%
 
 
 
 
 
 
r(   r   )5r&   asyncior8   typingr   r   r   r   r   http_parserr	   typedefsr
   rl   rq   ImportErrorclient_reqrepr   r   r   r   __all__r   r   r   r   r   r   rU   r   rp   r   r   r   ry   r   r   TimeoutErrorr   r   r   r7   r    r   CertificateErrorcert_errorscert_errors_basesSSLError
ssl_errorsssl_error_basestupler   r   r'   r(   r)   <module>r      s       = = = = = = = = = = = = = = + + + + + + " " " " " "JJJJJ   C***  8VVVVVVVVVVVVV377K7.=,3 3 3 3 3) 3 3 3L L L L L+ L L L^* * * * ** * * *, , , , ,0 , , ,    .   0 0 0 0 0* 0 0 0/ / / / /K / / /    )7   #* #* #* #* #*= #* #* #*L    !5   
 
 
 
 
3 
 
 
.$ $ $ $ $1 $ $ $    3            .0D      
 
 
 
 
 5 
 
 
 " " " " " " " "9 9 9 9 9j 9 9 9,& & & & &) & & & ?')K
 ,J%s|4OO%''K
 J%'O         
 
 
 
 
 
'8 
 
 
 
 
 
s   2 	>>