
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
U
    '7`Q!                     @   s(  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
 zddlZejZW n ek
rj   d ZZY nX erddlmZmZmZmZ nd Z ZZdZG dd	 d	eZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deeZG dd deZG dd deZG dd deZ G dd de Z!G d d! d!e ej"Z#G d"d# d#e Z$G d$d% d%eZ%G d&d' d'ee&Z'G d(d) d)eZ(edk	rej)fZ*e(ej)fZ+ej,fZ-e(ej,fZ.ne/ Z*e(e&fZ+e/ Z-e(fZ.G d*d+ d+fe. Z0G d,d- d-fe+ Z1dS ).zHTTP related errors.    N)TYPE_CHECKINGAnyOptionalTupleUnion   )LooseHeaders)ClientResponseConnectionKeyFingerprintRequestInfo)ClientErrorClientConnectionErrorClientOSErrorClientConnectorErrorClientProxyConnectionErrorClientSSLErrorClientConnectorSSLErrorClientConnectorCertificateErrorServerConnectionErrorServerTimeoutErrorServerDisconnectedErrorServerFingerprintMismatchClientResponseErrorClientHttpProxyErrorWSServerHandshakeErrorContentTypeErrorClientPayloadError
InvalidURLc                   @   s   e Zd ZdZdS )r   z(Base class for client connection errors.N__name__
__module____qualname____doc__ r$   r$   L/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/client_exceptions.pyr   ,   s   r   c                	   @   s   e Zd ZdZdddddeeedf ee ee e	ee
 ddddZe	d	d
dZe	d	ddZeed	ddZejeddddZdS )r   zYConnection error during reading response.

    request_info: instance of RequestInfo
    N )codestatusmessageheaders.)request_infohistoryr'   r(   r)   r*   returnc                C   st   || _ |d k	r.|d k	rtdtjdtdd |d k	r>|| _n|d k	rN|| _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   )
r+   
ValueErrorwarningswarnDeprecationWarningr(   r)   r*   r,   args)selfr+   r,   r'   r(   r)   r*   r$   r$   r%   __init__6   s(    
zClientResponseError.__init__r-   c                 C   s   d | j| j| jjS )Nz{}, message={!r}, url={!r})formatr(   r)   r+   Zreal_urlr6   r$   r$   r%   __str__W   s
    zClientResponseError.__str__c                 C   sr   | j d| j}| jdkr,|d| j7 }| jdkrF|d| j7 }| jd k	r`|d| j7 }dt| j|S )Nz, r   z	, status=r&   z
, message=z
, headers=z{}({}))r+   r,   r(   r)   r*   r9   typer    )r6   r5   r$   r$   r%   __repr__^   s    


zClientResponseError.__repr__c                 C   s   t jdtdd | jS Nz/code property is deprecated, use status insteadr.   r/   r2   r3   r4   r(   r:   r$   r$   r%   r'   h   s    zClientResponseError.code)valuer-   c                 C   s   t jdtdd || _d S r>   r?   )r6   r@   r$   r$   r%   r'   q   s    )r    r!   r"   r#   r   r   r	   r   intstrr   r7   r;   r=   propertyr'   setterr$   r$   r$   r%   r   0   s(   

!
r   c                   @   s   e Zd ZdZdS )r   zContentType found is not valid.Nr   r$   r$   r$   r%   r   {   s   r   c                   @   s   e Zd ZdZdS )r   z!websocket server handshake error.Nr   r$   r$   r$   r%   r      s   r   c                   @   s   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   c                   @   s   e Zd ZdZdS )TooManyRedirectsz%Client was redirected too many times.Nr   r$   r$   r$   r%   rE      s   rE   c                   @   s   e Zd ZdZdS )r   z$Base class for client socket errors.Nr   r$   r$   r$   r%   r      s   r   c                   @   s   e Zd ZdZdS )r   zOSError error.Nr   r$   r$   r$   r%   r      s   r   c                       s   e Zd ZdZeedd fddZeedddZee	dd	d
Z
eee dddZeeededf dddZe	dddZejZ  ZS )r   zClient connector error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        connection to proxy can not be established.
    N)connection_keyos_errorr-   c                    s,   || _ || _t |j|j ||f| _d S N)	_conn_key	_os_errorsuperr7   errnostrerrorr5   )r6   rF   rG   	__class__r$   r%   r7      s    zClientConnectorError.__init__r8   c                 C   s   | j S rH   )rJ   r:   r$   r$   r%   rG      s    zClientConnectorError.os_errorc                 C   s   | j jS rH   rI   hostr:   r$   r$   r%   rQ      s    zClientConnectorError.hostc                 C   s   | j jS rH   rI   portr:   r$   r$   r%   rS      s    zClientConnectorError.portr   c                 C   s   | j jS rH   )rI   sslr:   r$   r$   r%   rT      s    zClientConnectorError.sslc                 C   s    d | | jd k	r| jnd| jS )Nz6Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]default)r9   rT   rM   r:   r$   r$   r%   r;      s
      zClientConnectorError.__str__)r    r!   r"   r#   r
   OSErrorr7   rC   rG   rB   rQ   r   rA   rS   r   
SSLContextboolrT   r;   BaseException
__reduce____classcell__r$   r$   rN   r%   r      s   r   c                   @   s   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   c                   @   s   e Zd ZdZdS )r   zServer connection errors.Nr   r$   r$   r$   r%   r      s   r   c                   @   s&   e Zd ZdZdee ddddZdS )r   zServer disconnected.N)r)   r-   c                 C   s   |d krd}|f| _ || _d S )NzServer disconnected)r5   r)   )r6   r)   r$   r$   r%   r7      s    z ServerDisconnectedError.__init__)N)r    r!   r"   r#   r   rB   r7   r$   r$   r$   r%   r      s   r   c                   @   s   e Zd ZdZdS )r   zServer timeout error.Nr   r$   r$   r$   r%   r      s   r   c                   @   s4   e Zd ZdZeeeeddddZedddZdS )	r   z4SSL certificate does not match expected fingerprint.N)expectedgotrQ   rS   r-   c                 C   s*   || _ || _|| _|| _||||f| _d S rH   )r\   r]   rQ   rS   r5   )r6   r\   r]   rQ   rS   r$   r$   r%   r7      s
    z"ServerFingerprintMismatch.__init__r8   c                 C   s   d | jj| j| j| j| jS )Nz/<{} expected={!r} got={!r} host={!r} port={!r}>)r9   rO   r    r\   r]   rQ   rS   r:   r$   r$   r%   r=      s        z"ServerFingerprintMismatch.__repr__)	r    r!   r"   r#   bytesrB   rA   r7   r=   r$   r$   r$   r%   r      s   r   c                   @   s   e Zd ZdZdS )r   zResponse payload error.Nr   r$   r$   r$   r%   r      s   r   c                       sH   e Zd ZdZedd fddZeedddZedd	d
Z	  Z
S )r   z]Invalid URL.

    URL used for fetching is malformed, e.g. it doesn't contains host
    part.N)urlr-   c                    s   t  | d S rH   )rK   r7   )r6   r_   rN   r$   r%   r7      s    zInvalidURL.__init__r8   c                 C   s
   | j d S )Nr   )r5   r:   r$   r$   r%   r_      s    zInvalidURL.urlc                 C   s   d| j j d| j dS )N< >)rO   r    r_   r:   r$   r$   r%   r=      s    zInvalidURL.__repr__)r    r!   r"   r#   r   r7   rC   r_   rB   r=   r[   r$   r$   rN   r%   r      s
   r   c                   @   s   e Zd ZdZdS )r   zBase error for ssl.*Errors.Nr   r$   r$   r$   r%   r     s   r   c                   @   s   e Zd ZdZdS )r   zResponse ssl error.Nr   r$   r$   r$   r%   r     s   r   c                   @   s|   e Zd ZdZeeddddZeedddZee	dd	d
Z
eee dddZeedddZe	dddZdS )r   zResponse certificate error.N)rF   certificate_errorr-   c                 C   s   || _ || _||f| _d S rH   )rI   _certificate_errorr5   )r6   rF   rc   r$   r$   r%   r7   !  s    z(ClientConnectorCertificateError.__init__r8   c                 C   s   | j S rH   )rd   r:   r$   r$   r%   rc   (  s    z1ClientConnectorCertificateError.certificate_errorc                 C   s   | j jS rH   rP   r:   r$   r$   r%   rQ   ,  s    z$ClientConnectorCertificateError.hostc                 C   s   | j jS rH   rR   r:   r$   r$   r%   rS   0  s    z$ClientConnectorCertificateError.portc                 C   s   | j jS rH   )rI   Zis_sslr:   r$   r$   r%   rT   4  s    z#ClientConnectorCertificateError.sslc                 C   s
   d | S )Nz{Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} [{0.certificate_error.__class__.__name__}: {0.certificate_error.args}])r9   r:   r$   r$   r%   r;   8  s    z'ClientConnectorCertificateError.__str__)r    r!   r"   r#   r
   	Exceptionr7   rC   rc   rB   rQ   r   rA   rS   rX   rT   r;   r$   r$   r$   r%   r     s    r   )2r#   Zasyncior2   typingr   r   r   r   r   Ztypedefsr   rT   rW   ImportErrorZclient_reqrepr	   r
   r   r   __all__re   r   r   r   r   r   rE   r   rV   r   r   r   r   r   TimeoutErrorr   r   r   r1   r   r   ZCertificateErrorZcert_errorsZcert_errors_basesZSSLErrorZ
ssl_errorsZssl_error_basestupler   r   r$   r$   r$   r%   <module>   sZ   
K	&
