HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/aiohttp/__pycache__/client_exceptions.cpython-310.pyc
o

���gg,�@sdZddlZddlZddlmZmZmZmZddlm	Z	ddl
mZer,ddlZej
Z
nz	ddlZej
Z
Wn
eyBdZZ
YnwerXddlmZmZmZmZddlmZndZZZZd	ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dee�Z Gdd�dee!�Z"Gdd�de"�Z#Gdd�de#�Z$Gd d!�d!e#�Z%Gd"d#�d#e#�Z&Gd$d%�d%e�Z'Gd&d'�d'e'�Z(Gd(d)�d)e'ej)�Z*Gd*d+�d+e*�Z+Gd,d-�d-e*�Z,Gd.d/�d/e'�Z-Gd0d1�d1e�Z.Gd2d3�d3ee/�Z0Gd4d5�d5e0�Z1Gd6d7�d7e�Z2Gd8d9�d9e�Z3Gd:d;�d;e1e2�Z4Gd<d=�d=e3e2�Z5Gd>d?�d?e#�Z6edu�rYej7fZ8e6ej7fZ9ej:fZ;e6ej:fZ<n
e=�Z8e6e/fZ9e=�Z;e6fZ<Gd@dA�dAge<�R�Z>GdBdC�dCge9�R�Z?GdDdE�dEe@�ZAdS)FzHTTP related errors.�N)�
TYPE_CHECKING�Optional�Tuple�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@�eZdZdZdS)rz(Base class for client connection errors.N��__name__�
__module__�__qualname__�__doc__�r0r0�D/usr/local/lib/python3.10/dist-packages/aiohttp/client_exceptions.pyr=�rc@s�eZdZdZddddd�dedeedfdeed	eed
e	dee
e	ddfd
d�Zde	fdd�Zde	fdd�Z
edefdd��Zejdeddfdd��ZdS)raBase 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.r4r5r6r7�returncCst||_|dur|durtd��tjdtdd�|dur||_n|dur'||_nd|_||_||_||_||f|_	dS)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�DeprecationWarningr5r6r7r9�args)�selfr8r9r4r5r6r7r0r0r1�__init__Ks(
��zClientResponseError.__init__cCsd�|j|jt|jj��S)Nz{}, message={!r}, url={!r})�formatr5r6�strr8�real_url�rCr0r0r1�__str__ls

�zClientResponseError.__str__cCsv|j�d|j��}|jdkr|d|j��7}|jdkr#|d|j��7}|jdur0|d|j��7}t|�j�d|�d�S)	Nz, rz	, status=r3z
, message=z
, headers=�(�))r8r9r5r6r7�typer,)rCrBr0r0r1�__repr__ss


zClientResponseError.__repr__cCstjdtdd�|jS�Nz/code property is deprecated, use status insteadr;r<�r?r@rAr5rHr0r0r1r4}s�zClientResponseError.code�valuecCstjdtdd�||_dSrNrO)rCrPr0r0r1r4�s�
)r,r-r.r/rrr	r�intrFrrDrIrM�propertyr4�setterr0r0r0r1rAs6��
����
�	
�!
rc@r*)r!zContentType found is not valid.Nr+r0r0r0r1r!�r2r!c@r*)r z!websocket server handshake error.Nr+r0r0r0r1r �r2r c@r*)rz�HTTP proxy error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
    proxy responds with status other than ``200 OK``
    on ``CONNECT`` request.
    Nr+r0r0r0r1r�r2rc@r*)�TooManyRedirectsz%Client was redirected too many times.Nr+r0r0r0r1rT�r2rTc@r*)rz$Base class for client socket errors.Nr+r0r0r0r1r�r2rc@r*)r�ConnectionResetErrorNr+r0r0r0r1r�r2rc@r*)rzOSError error.Nr+r0r0r0r1r�r2rcs�eZdZdZdededdf�fdd�Zedefdd	��Zede	fd
d��Z
edeefdd
��Z
edeeedffdd��Zde	fdd�ZejZ�ZS)rz�Client connector error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        a connection can not be established.
    �connection_key�os_errorr:Ncs,||_||_t��|j|j�||f|_dS�N)�	_conn_key�	_os_error�superrD�errno�strerrorrB)rCrVrW��	__class__r0r1rD�szClientConnectorError.__init__cC�|jSrX)rZrHr0r0r1rW��zClientConnectorError.os_errorcC�|jjSrX�rY�hostrHr0r0r1rd��zClientConnectorError.hostcCrbrX�rY�portrHr0r0r1rg�rezClientConnectorError.portrcCrbrX)rY�sslrHr0r0r1rh�rezClientConnectorError.sslcC�&d�||jdur
d|j�S|j|j�S)Nz6Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]T�default�rErhr]rHr0r0r1rI��
��zClientConnectorError.__str__)r,r-r.r/r
�OSErrorrDrRrWrFrdrrQrgr�
SSLContext�boolrhrI�
BaseException�
__reduce__�
__classcell__r0r0r^r1r�src@r*)rz�DNS resolution failed during client connection.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        DNS resolution fails.
    Nr+r0r0r0r1r�r2rc@r*)rz�Proxy connection error.

    Raised in :class:`aiohttp.connector.TCPConnector` if
        connection to proxy can not be established.
    Nr+r0r0r0r1r�r2rcsReZdZdZdedededdf�fdd�Zedefd	d
��Z	defdd�Z
�ZS)
�UnixClientConnectorErrorz�Unix connector error.

    Raised in :py:class:`aiohttp.connector.UnixConnector`
    if connection to unix socket can not be established.
    �pathrVrWr:Ncs||_t��||�dSrX)�_pathr[rD)rCrtrVrWr^r0r1rD�sz!UnixClientConnectorError.__init__cCr`rX)rurHr0r0r1rt�razUnixClientConnectorError.pathcCri)Nz4Cannot connect to unix socket {0.path} ssl:{1} [{2}]TrjrkrHr0r0r1rI�rlz UnixClientConnectorError.__str__)r,r-r.r/rFr
rmrDrRrtrIrrr0r0r^r1rs�s����rsc@r*)rzServer connection errors.Nr+r0r0r0r1r�r2rc@s.eZdZdZddeeedfddfdd�ZdS)rzServer disconnected.Nr6r:cCs|durd}|f|_||_dS)NzServer disconnected)rBr6)rCr6r0r0r1rDs
z ServerDisconnectedError.__init__rX)r,r-r.r/rr
rFrDr0r0r0r1rs"rc@r*)rzServer timeout error.Nr+r0r0r0r1r
r2rc@r*)rzConnection timeout error.Nr+r0r0r0r1rr2rc@r*)rzSocket timeout error.Nr+r0r0r0r1rr2rc
@s<eZdZdZdededededdf
dd	�Zdefd
d�ZdS)rz4SSL certificate does not match expected fingerprint.�expected�gotrdrgr:NcCs*||_||_||_||_||||f|_dSrX)rvrwrdrgrB)rCrvrwrdrgr0r0r1rDs
z"ServerFingerprintMismatch.__init__cCsd�|jj|j|j|j|j�S)Nz/<{} expected={!r} got={!r} host={!r} port={!r}>)rEr_r,rvrwrdrgrHr0r0r1rM#s�z"ServerFingerprintMismatch.__repr__)	r,r-r.r/�bytesrFrQrDrMr0r0r0r1rsrc@r*)r"zResponse payload error.Nr+r0r0r0r1r")r2r"csteZdZdZddedeedfddf�fdd�
Zedefdd	��Z	eddd��Z
defd
d�Zdefdd�Z�Z
S)r#zbInvalid URL.

    URL used for fetching is malformed, e.g. it doesn't contains host
    part.
    N�url�descriptionr:cs2||_||_|rt��||�dSt��|�dSrX)�_url�_descriptionr[rD)rCryrzr^r0r1rD6s
zInvalidURL.__init__cCr`rX)r{rHr0r0r1ryArazInvalidURL.url�
str | NonecCr`rX)r|rHr0r0r1rzErazInvalidURL.descriptioncCsd|jj�d|�d�S)N�<� �>)r_r,rHr0r0r1rMIszInvalidURL.__repr__cCs"|jr|j�d|j��St|j�S)Nz - )r|r{rFrHr0r0r1rILs
zInvalidURL.__str__rX)r:r})r,r-r.r/rrrFrDrRryrzrMrIrrr0r0r^r1r#-s$r#c@r*)r$zInvalid URL client error.Nr+r0r0r0r1r$Rr2r$c@r*)r%zClient redirect error.Nr+r0r0r0r1r%Vr2r%c@r*)r&zNon http URL client error.Nr+r0r0r0r1r&Zr2r&c@r*)r'z"Invalid URL redirect client error.Nr+r0r0r0r1r'^r2r'c@r*)r(z#Non http URL redirect client error.Nr+r0r0r0r1r(br2r(c@r*)rzBase error for ssl.*Errors.Nr+r0r0r0r1rfr2rc@r*)rzResponse ssl error.Nr+r0r0r0r1r~r2rc@s�eZdZdZdededdfdd�Zedefdd	��Zede	fd
d��Z
edeefdd
��Z
edefdd��Zde	fdd�ZdS)rzResponse certificate error.rV�certificate_errorr:NcCs||_||_||f|_dSrX)rY�_certificate_errorrB)rCrVr�r0r0r1rD�sz(ClientConnectorCertificateError.__init__cCr`rX)r�rHr0r0r1r��raz1ClientConnectorCertificateError.certificate_errorcCrbrXrcrHr0r0r1rd�rez$ClientConnectorCertificateError.hostcCrbrXrfrHr0r0r1rg�rez$ClientConnectorCertificateError.portcCrbrX)rY�is_sslrHr0r0r1rh�rez#ClientConnectorCertificateError.sslcCs
d�|�S)Nz{Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} [{0.certificate_error.__class__.__name__}: {0.certificate_error.args}])rErHr0r0r1rI�s�z'ClientConnectorCertificateError.__str__)r,r-r.r/r
�	ExceptionrDrRr�rFrdrrQrgrorhrIr0r0r0r1r�s$��
�rc@r*)r)z$WebSocket message type is not valid.Nr+r0r0r0r1r)�r2r))Br/�asyncior?�typingrrrr�	multidictr�typedefsrrhrn�ImportError�
client_reqrepr	r
rr�http_parserr
�__all__r�rrr!r rrTrrUrrmrrrrrsrr�TimeoutErrorrrrrr"r>r#r$r%r&r'r(r�CertificateError�cert_errors�cert_errors_bases�SSLError�
ssl_errors�ssl_error_bases�tuplerr�	TypeErrorr)r0r0r0r1�<module>s~
� O	&%
��"