
    3Cf$                     *   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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jJ                        Z& G d% d&e#      Z' G d' d(e      Z( G d) d*ee)      Z* G d+ d,e       Z+e7ejX                  fZ-e+ejX                  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 Z3 G d/ d0ge. Z4y# e$ r dxZZY [w xY w)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y)r   z(Base class for client connection errors.N__name__
__module____qualname____doc__     Y/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/aiohttp/client_exceptions.pyr   r   -   s    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y)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| _	        y )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     )! =  MMA"
  DKDKDK!7+	r(   c                 x    dj                  | j                  | j                  | j                  j                        S )Nz{}, message={!r}, url={!r})formatr-   r.   r0   real_urlr<   s    r)   __str__zClientResponseError.__str__\   s2    +22KKLL&&
 	
r(   c                 .   | j                   d| j                  }| j                  dk7  r|d| j                  z  }| j                  dk7  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    ##&b(89;;!i//D<<2j 011D<<#j 011Dt*%%&avQ//r(   c                 R    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                 J    t        j                  dt        d       || _        y rI   rJ   )r<   rK   s     r)   r,   zClientResponseError.codev   s     =	

 r(   )r#   r$   r%   r&   r   r   r   r   intstrr
   r=   rB   rG   propertyr,   setterr'   r(   r)   r   r   1   s     # $*.,!, ~s*+,
 sm, , , ,', 
,B
 
0# 0 c   
[[# $  r(   r   c                       e Zd ZdZy)r   zContentType found is not valid.Nr"   r'   r(   r)   r   r      s    )r(   r   c                       e Zd ZdZy)r   z!websocket server handshake error.Nr"   r'   r(   r)   r   r      s    +r(   r   c                       e Zd ZdZy)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y)TooManyRedirectsz%Client was redirected too many times.Nr"   r'   r(   r)   rU   rU      s    /r(   rU   c                       e Zd ZdZy)r   z$Base class for client socket errors.Nr"   r'   r(   r)   r   r      s    .r(   r   c                       e Zd ZdZy)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| _        y N)	_conn_key	_os_errorsuperr=   errnostrerrorr;   )r<   rY   rZ   	__class__s      r)   r=   zClientConnectorError.__init__   s6    '!):):;#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                     dj                  | | j                  du rd| j                        S | 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__   sB    GNNtxx4/)t}}
 	
59XXt}}
 	
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 / '   #c # # #hsm # # "U:t]:; " "
 
 ))Jr(   r   c                       e Zd ZdZy)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                   V     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                 4    || _         t        | 	  ||       y r\   )_pathr_   r=   )r<   rz   rY   rZ   rb   s       r)   r=   z!UnixClientConnectorError.__init__   s     
2r(   c                     | j                   S r\   )r|   rA   s    r)   rz   zUnixClientConnectorError.path   s    zzr(   c                     dj                  | | j                  du rd| j                        S | j                  | j                        S )Nz4Cannot connect to unix socket {0.path} ssl:{1} [{2}]Trn   ro   rA   s    r)   rB   z UnixClientConnectorError.__str__   sB    ELLtxx4/)t}}
 	
59XXt}}
 	
r(   )r#   r$   r%   r&   rN   r   rp   r=   rO   rz   rB   ru   rv   s   @r)   ry   ry      sT    33)63BI3	3 c  
 
r(   ry   c                       e Zd ZdZy)r   zServer connection errors.Nr"   r'   r(   r)   r   r      s    #r(   r   c                   .    e Zd ZdZddeeedf   ddfdZy)r   zServer disconnected.Nr.   r2   c                 *    |d}|f| _         || _        y )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      s&    &8#t&C D PT r(   r   c                       e Zd ZdZy)r   zServer timeout error.Nr"   r'   r(   r)   r   r      s    r(   r   c            
       8    e Zd ZdZdededededdf
dZdefd	Zy)
r   z4SSL certificate does not match expected fingerprint.expectedgotrf   rj   r2   Nc                 R    || _         || _        || _        || _        ||||f| _        y r\   )r   r   rf   rj   r;   )r<   r   r   rf   rj   s        r)   r=   z"ServerFingerprintMismatch.__init__   s.     		sD$/	r(   c                     dj                  | 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__   s:    @GGNN##T]]DHHdii
 	
r(   )	r#   r$   r%   r&   bytesrN   rM   r=   rG   r'   r(   r)   r   r      s9    >0 0U 0# 0S 0T 0
# 
r(   r   c                       e Zd ZdZy)r   zResponse payload error.Nr"   r'   r(   r)   r   r     s    !r(   r   c                   N     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                 $    t         |   |       y 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    yy|r(   c                 P    d| j                   j                   d| j                   dS )N< >)rb   r#   r   rA   s    r)   rG   zInvalidURL.__repr__  s&    4>>**+1TXXJa88r(   )r#   r$   r%   r&   r   r=   rO   r   rN   rG   ru   rv   s   @r)   r    r    	  sB    C D 
 S  9# 9r(   r    c                       e Zd ZdZy)r   zBase error for ssl.*Errors.Nr"   r'   r(   r)   r   r     s    %r(   r   c                       e Zd ZdZy)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y)r   zResponse certificate error.rY   certificate_errorr2   Nc                 2    || _         || _        ||f| _        y 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j                  |       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 '9 ' ' #c # # #hsm # # %T % %
 
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      = = + "J
 VV377K7.=,3) 3L+ L^** *,0 ,. 0* 0/K /)7 #*= #*L!5 
3 
.$1 $3  .0D0D  
 5 
 " "9j 9,&) & ?'')K
 ,,J%s||4O'K
 J%'O 
'8 
[	  C*s   F 	FF