
    *GjY-                        d Z ddlZddlZddlmZmZ ddlmZ ddlm	Z	 erddl
Z
e
j        Zn	 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 ddlmZ ndxZ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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j'                  Z( G d* d+e(          Z) G d, d-e(          Z* G d. d/e%          Z+ G d0 d1e          Z, G d2 d3ee-          Z. G d4 d5e.          Z/ G d6 d7e          Z0 G d8 d9e          Z1 G d: d;e/e0          Z2 G d< d=e1e0          Z3 G d> d?e!          Z4e
#e
j5        fZ6e4e
j5        fZ7e
j8        fZ9e4e
j8        fZ:n e;            Z6e4e-fZ7 e;            Z9e4fZ: G d@ dAge:R  Z< G dB dCge7R  Z= G dD dEe>          Z?dS )FzHTTP related errors.    N)TYPE_CHECKINGUnion)MultiMapping   )StrOrURL)ClientResponseConnectionKeyFingerprintRequestInfo)RawResponseMessage)ClientErrorClientConnectionErrorClientConnectionResetErrorClientOSErrorClientConnectorErrorClientProxyConnectionErrorClientSSLErrorClientConnectorDNSErrorClientConnectorSSLErrorClientConnectorCertificateErrorConnectionTimeoutErrorSocketTimeoutErrorServerConnectionErrorServerTimeoutErrorServerDisconnectedErrorServerFingerprintMismatchClientResponseErrorClientHttpProxyErrorWSServerHandshakeErrorContentTypeErrorClientPayloadError
InvalidURLInvalidUrlClientErrorRedirectClientErrorNonHttpUrlClientErrorInvalidUrlRedirectClientErrorNonHttpUrlRedirectClientErrorWSMessageTypeErrorc                       e Zd ZdZdS )r   z(Base class for client connection errors.N__name__
__module____qualname____doc__     a/home/rurouni/.hermes/hermes-agent/venv/lib/python3.11/site-packages/aiohttp/client_exceptions.pyr   r   =   s        2222r0   r   c                       e Zd ZdZddddddedeedf         dedz  d	edz  d
ede	e         dz  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.r4   r5   r6   r7   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   )
r8   
ValueErrorwarningswarnDeprecationWarningr5   r6   r7   r9   args)selfr8   r9   r4   r5   r6   r7   s          r1   __init__zClientResponseError.__init__K   s     )! =   MA"   
  DKKDKKDK!7+			r0   c                 X    | j          d| j        dt          | j        j                  S )N
, message=z, url=)r5   r6   strr8   real_urlrD   s    r1   __str__zClientResponseError.__str__l   s0    +bbbbs4CTC]?^?^bbbr0   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=r3   rG   z
, headers=())r8   r9   r5   r6   r7   typer+   )rD   rC   s     r1   __repr__zClientResponseError.__repr__o   s    #9999;!////D<21111D<#1111Dt**%//////r0   c                 H    t          j        dt          d           | j        S Nz/code property is deprecated, use status insteadr<   r=   r@   rA   rB   r5   rJ   s    r1   r4   zClientResponseError.codey   s.    =	
 	
 	
 	

 {r0   valuec                 L    t          j        dt          d           || _        d S rR   rS   )rD   rT   s     r1   r4   zClientResponseError.code   s1    =	
 	
 	
 	

 r0   )r+   r,   r-   r.   r   tupler   intrH   r   rE   rK   rP   propertyr4   setterr/   r0   r1   r   r   A   s=          !,0, , ,!, ~s*+,
 Dj, d
, , c"T), 
, , , ,Bc c c c c0# 0 0 0 0 c    X 
[# $    [  r0   r   c                       e Zd ZdZdS )r    zContentType found is not valid.Nr*   r/   r0   r1   r    r       s        ))))r0   r    c                       e Zd ZdZdS )r   z!websocket server handshake error.Nr*   r/   r0   r1   r   r      s        ++++r0   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/   r0   r1   r   r      s           r0   r   c                       e Zd ZdZdS )TooManyRedirectsz%Client was redirected too many times.Nr*   r/   r0   r1   r^   r^      s        ////r0   r^   c                       e Zd ZdZdS )r   z$Base class for client socket errors.Nr*   r/   r0   r1   r   r              ....r0   r   c                       e Zd ZdZdS )r   ConnectionResetErrorNr*   r/   r0   r1   r   r      s        r0   r   c                       e Zd ZdZdS )r   zOSError error.Nr*   r/   r0   r1   r   r      s        r0   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dz  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_errorr:   Nc                     || _         || _        t                                          |j        |j                   ||f| _        d S N)	_conn_key	_os_errorsuperrE   errnostrerrorrC   )rD   re   rf   	__class__s      r1   rE   zClientConnectorError.__init__   s@    '!):;;;#X.			r0   c                     | j         S rh   )rj   rJ   s    r1   rf   zClientConnectorError.os_error   s
    ~r0   c                     | j         j        S rh   ri   hostrJ   s    r1   rr   zClientConnectorError.host       ~""r0   c                     | j         j        S rh   ri   portrJ   s    r1   rv   zClientConnectorError.port   rs   r0   r
   c                     | j         j        S rh   )ri   sslrJ   s    r1   rx   zClientConnectorError.ssl   s    ~!!r0   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formatrx   rm   rJ   s    r1   rK   zClientConnectorError.__str__   s5    GNNtx4//))TXt}
 
 	
r0   )r+   r,   r-   r.   r	   OSErrorrE   rX   rf   rH   rr   rW   rv   r   
SSLContextboolrx   rK   BaseException
__reduce____classcell__rn   s   @r1   r   r      s!        /} / /D / / / / / / '    X #c # # # X# #cDj # # # X# "U:t]:; " " " X"
 
 
 
 
 )JJJJJr0   r   c                       e Zd ZdZdS )r   zDNS resolution failed during client connection.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        DNS resolution fails.
    Nr*   r/   r0   r1   r   r                 r0   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/   r0   r1   r   r      r   r0   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.
    pathre   rf   r:   Nc                 Z    || _         t                                          ||           d S rh   )_pathrk   rE   )rD   r   re   rf   rn   s       r1   rE   z!UnixClientConnectorError.__init__   s,     
22222r0   c                     | j         S rh   )r   rJ   s    r1   r   zUnixClientConnectorError.path   s
    zr0   c                 Z    d                     | | j        du rdn| j        | j                  S )Nz4Cannot connect to unix socket {0.path} ssl:{1} [{2}]Trz   r{   rJ   s    r1   rK   z UnixClientConnectorError.__str__   s5    ELLtx4//))TXt}
 
 	
r0   )r+   r,   r-   r.   rH   r	   r}   rE   rX   r   rK   r   r   s   @r1   r   r      s         33)63BI3	3 3 3 3 3 3 c    X
 
 
 
 
 
 
 
 
r0   r   c                       e Zd ZdZdS )r   zServer connection errors.Nr*   r/   r0   r1   r   r              ####r0   r   c                   0    e Zd ZdZddeez  dz  ddfdZdS )r   zServer disconnected.Nr6   r:   c                 ,    |d}|f| _         || _        d S )NzServer disconnected)rC   r6   )rD   r6   s     r1   rE   z ServerDisconnectedError.__init__  s     ?+GJ	r0   rh   )r+   r,   r-   r.   r   rH   rE   r/   r0   r1   r   r      sL          2S 84 ? 4      r0   r   c                       e Zd ZdZdS )r   zServer timeout error.Nr*   r/   r0   r1   r   r   	          r0   r   c                       e Zd ZdZdS )r   zConnection timeout error.Nr*   r/   r0   r1   r   r     r   r0   r   c                       e Zd ZdZdS )r   zSocket timeout error.Nr*   r/   r0   r1   r   r     r   r0   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gotrr   rv   r:   Nc                 T    || _         || _        || _        || _        ||||f| _        d S rh   )r   r   rr   rv   rC   )rD   r   r   rr   rv   s        r1   rE   z"ServerFingerprintMismatch.__init__  s2     		sD$/			r0   c                 b    d| j         j         d| j        d| j        d| j        d| j        dS )N<z
 expected=z got=z host=z port=>)rn   r+   r   r   rr   rv   rJ   s    r1   rP   z"ServerFingerprintMismatch.__repr__  sD    4>*dmDH^b^gquqzr0   )	r+   r,   r-   r.   bytesrH   rW   rE   rP   r/   r0   r1   r   r     ss        >>0 0U 0# 0S 0T 0 0 0 0@# @ @ @ @ @ @r0   r   c                       e Zd ZdZdS )r!   zResponse payload error.Nr*   r/   r0   r1   r!   r!   #  s        !!!!r0   r!   c                        e Zd ZdZddededz  ddf fdZedefd            Zedd	            Z	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.
    Nurldescriptionr:   c                     || _         || _        |r$t                                          ||           d S t                                          |           d S rh   )_url_descriptionrk   rE   )rD   r   r   rn   s      r1   rE   zInvalidURL.__init__0  sZ     	' 	"GGS+.....GGS!!!!!r0   c                     | j         S rh   )r   rJ   s    r1   r   zInvalidURL.url;  s
    yr0   
str | Nonec                     | j         S rh   )r   rJ   s    r1   r   zInvalidURL.description?  s      r0   c                 (    d| j         j         d|  dS )Nr    r   )rn   r+   rJ   s    r1   rP   zInvalidURL.__repr__C  s     44>*44T4444r0   c                 Z    | j         r| j         d| j          S t          | j                  S )Nz - )r   r   rH   rJ   s    r1   rK   zInvalidURL.__str__F  s4     	8i77D$577749~~r0   rh   )r:   r   )r+   r,   r-   r.   r   rH   rE   rX   r   r   rP   rK   r   r   s   @r1   r"   r"   '  s         	" 	"H 	"3: 	" 	" 	" 	" 	" 	" 	" X    X ! ! ! X!5# 5 5 5 5        r0   r"   c                       e Zd ZdZdS )r#   zInvalid URL client error.Nr*   r/   r0   r1   r#   r#   L  r   r0   r#   c                       e Zd ZdZdS )r$   zClient redirect error.Nr*   r/   r0   r1   r$   r$   P  s            r0   r$   c                       e Zd ZdZdS )r%   zNon http URL client error.Nr*   r/   r0   r1   r%   r%   T  s        $$$$r0   r%   c                       e Zd ZdZdS )r&   z"Invalid URL redirect client error.Nr*   r/   r0   r1   r&   r&   X  s        ,,,,r0   r&   c                       e Zd ZdZdS )r'   z#Non http URL redirect client error.Nr*   r/   r0   r1   r'   r'   \  s        ----r0   r'   c                       e Zd ZdZdS )r   zBase error for ssl.*Errors.Nr*   r/   r0   r1   r   r   `  s        %%%%r0   r   c                       e Zd ZdZdS )r   zResponse ssl error.Nr*   r/   r0   r1   r   r   x  s        r0   r   c                        e Zd ZU dZeed<   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dz  fd
            Zedefd            Zde
fdZ xZS )r   zResponse certificate error.ri   re   certificate_errorr:   Nc                     t          |t          t          fz             r|}nt                      }t                                          ||           || _        ||f| _        d S rh   )
isinstancecert_errorsr}   rk   rE   _certificate_errorrC   )rD   re   r   rf   rn   s       r1   rE   z(ClientConnectorCertificateError.__init__  sb     'z)ABB 	!(HHyyH222"3#%67			r0   c                     | j         S rh   )r   rJ   s    r1   r   z1ClientConnectorCertificateError.certificate_error  s    &&r0   c                     | j         j        S rh   rq   rJ   s    r1   rr   z$ClientConnectorCertificateError.host  rs   r0   c                     | j         j        S rh   ru   rJ   s    r1   rv   z$ClientConnectorCertificateError.port  rs   r0   c                     | j         j        S rh   )ri   is_sslrJ   s    r1   rx   z#ClientConnectorCertificateError.ssl  s    ~$$r0   c                 v    d| j          d| j         d| j         d| j        j        j         d| j        j         dS )NzCannot connect to host :z ssl:z [z: ])rr   rv   rx   r   rn   r+   rC   rJ   s    r1   rK   z'ClientConnectorCertificateError.__str__  sd    .di . .$) . .$( . .&09. .%*. . .	
r0   )r+   r,   r-   r.   r	   __annotations__	ExceptionrE   rX   r   rH   rr   rW   rv   r   rx   rK   r   r   s   @r1   r   r   |  s*        %%8 &8 %	8
 
8 8 8 8 8 8  '9 ' ' ' X' #c # # # X# #cDj # # # X# %T % % % X%
 
 
 
 
 
 
 
 
r0   r   c                       e Zd ZdZdS )r(   z$WebSocket message type is not valid.Nr*   r/   r0   r1   r(   r(     r`   r0   r(   )@r.   asyncior@   typingr   r   	multidictr   typedefsr   rx   r~   ImportErrorclient_reqrepr   r	   r
   r   http_parserr   __all__r   r   r   r    r   r   r^   r   rb   r   r}   r   r   r   r   r   r   r   TimeoutErrorr   r   r   r   r!   r?   r"   r#   r$   r%   r&   r'   r   CertificateErrorr   cert_errors_basesSSLError
ssl_errorsssl_error_basesrV   r   r   	TypeErrorr(   r/   r0   r1   <module>r      s       ' ' ' ' ' ' ' ' " " " " " "       
 JJJJJ 


^

      jjj   MVVVVVVVVVVVV///////HLLKL.L=3E@3 3 3 3 3) 3 3 3H H H H H+ H H HV* * * * ** * * *, , , , ,0 , , ,    .   0 0 0 0 0* 0 0 0/ / / / /K / / /    !68L       )7   #* #* #* #* #*= #* #* #*L    2       !5   
 
 
 
 
3 
 
 
.$ $ $ $ $1 $ $ $    3            .0D      $ $ $ $ $/ $ $ $         +      @ @ @ @ @ 5 @ @ @" " " " " " " "" " " " "j " " "J$ $ $ $ $J $ $ $! ! ! ! !+ ! ! !% % % % %K % % %- - - - -$9;N - - -. . . . .$9;N . . .& & & & &) & & & ?')K
 ,J%s|4OO%''K
 J%'O         *
 *
 *
 *
 *
 *
'8 *
 *
 *
 *
Z/ / / / / / / / / /s   : 	AA