� E�gg,���dZddlZddlZddlmZmZmZmZddlm Z ddl m Z er ddl Z e j Z n ddl Z e j Z n#e$rdxZ Z YnwxYwerddlmZmZmZmZddlmZndxZxZxZZd ZGd �d e��ZGd �d e��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�dee��Z Gd�dee!��Z"Gd�de"��Z#Gd�de#��Z$Gd �d!e#��Z%Gd"�d#e#��Z&Gd$�d%e��Z'Gd&�d'e'��Z(Gd(�d)e'ej)��Z*Gd*�d+e*��Z+Gd,�d-e*��Z,Gd.�d/e'��Z-Gd0�d1e��Z.Gd2�d3ee/��Z0Gd4�d5e0��Z1Gd6�d7e��Z2Gd8�d9e��Z3Gd:�d;e1e2��Z4Gd<�d=e3e2��Z5Gd>�d?e#��Z6e �#e j7fZ8e6e j7fZ9e j:fZ;e6e j:fZ<ne=��Z8e6e/fZ9e=��Z;e6fZ<Gd@�dAge<�R�Z>GdB�dCge9�R�Z?GdD�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__���i/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/aiohttp/client_exceptions.pyrr=s������2�2�2�2r2rc���eZdZdZddddd�dedeedfdeed eed e d ee e d dfd �Z d e fd�Z d e fd�Z ed efd���Zejded dfd���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.r6r7r8r9�returnc���||_|�-|�td���tjdtd���|�||_n|�||_nd|_||_||_||_||f|_ dS)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�DeprecationWarningr7r8r9r;�args)�selfr:r;r6r7r8r9s r3�__init__zClientResponseError.__init__Ks���)��� � ��!� �=���� �M�A�"�� � � � � � � �D�K�K� � ��D�K�K��D�K��� ��� ��� �!�7�+�� � � r2c�r�d�|j|jt|jj����S)Nz{}, message={!r}, url={!r})�formatr7r8�strr:�real_url�rFs r3�__str__zClientResponseError.__str__ls5��+�2�2� �K� �L� ��!�*� +� +� � � r2c���|j�d|j��}|jdkr |d|j��z }|jdkr |d|j��z }|j� |d|j��z }t |��j�d|�d�S) Nz, rz , status=r5z , message=z , headers=�(�))r:r;r7r8r9�typer-)rFrEs r3�__repr__zClientResponseError.__repr__ss����#�9�9���9�9�� �;�!� � � �/�� �/�/� /�D� �<�2� � � �1���1�1� 1�D� �<� #� �1���1�1� 1�D��t�*�*�%�/�/��/�/�/�/r2c�H�tjdtd���|jS�Nz/code property is deprecated, use status insteadr>r?�rBrCrDr7rLs r3r6zClientResponseError.code}s.��� � =� �� � � � � �{�r2�valuec�L�tjdtd���||_dSrTrU)rFrVs r3r6zClientResponseError.code�s1��� � =� �� � � � � �� � � r2)r-r.r/r0r rr r�intrJrrGrMrR�propertyr6�setterr1r2r3rrAs8��������#� $��/3�,�,�,�!�,��~�s�*�+�,� �s�m� ,� �� � ,��,��,�s�+�,�,� �,�,�,�,�B �� � � � �0�#�0�0�0�0���c�����X�� �[��#��$�����[���r2rc��eZdZdZdS)r"zContentType found is not valid.Nr,r1r2r3r"r"�s������)�)�)�)r2r"c��eZdZdZdS)r!z!websocket server handshake error.Nr,r1r2r3r!r!�s������+�+�+�+r2r!c��eZdZdZdS)r z�HTTP proxy error. Raised in :class:`aiohttp.connector.TCPConnector` if proxy responds with status other than ``200 OK`` on ``CONNECT`` request. Nr,r1r2r3r r �s���������r2r c��eZdZdZdS)�TooManyRedirectsz%Client was redirected too many times.Nr,r1r2r3r_r_�s������/�/�/�/r2r_c��eZdZdZdS)rz$Base class for client socket errors.Nr,r1r2r3rr��������.�.�.�.r2rc��eZdZdZdS)r�ConnectionResetErrorNr,r1r2r3rr�s���������r2rc��eZdZdZdS)rzOSError error.Nr,r1r2r3rr�s���������r2rc����eZdZdZdededdf�fd� Zedefd���Zede fd���Z ede e fd ���Z edeeed ffd ���Zde fd �ZejZ�xZS) rz�Client connector error. Raised in :class:`aiohttp.connector.TCPConnector` if a connection can not be established. �connection_key�os_errorr<Nc���||_||_t���|j|j��||f|_dS�N)� _conn_key� _os_error�superrG�errno�strerrorrE)rFrfrg� __class__s �r3rGzClientConnectorError.__init__�s@���'���!��� ��������):�;�;�;�#�X�.�� � � r2c��|jSri)rkrLs r3rgzClientConnectorError.os_error�s ���~�r2c��|jjSri�rj�hostrLs r3rszClientConnectorError.host�� ���~�"�"r2c��|jjSri�rj�portrLs r3rwzClientConnectorError.port�rtr2r c��|jjSri)rj�sslrLs r3ryzClientConnectorError.ssl�s ���~�!�!r2c�Z�d�||jdurdn|j|j��S)Nz6Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]T�default�rIryrnrLs r3rMzClientConnectorError.__str__�s5��G�N�N� �t�x�4�/�/�)�)�T�X�t�}� � � r2)r-r.r/r0r �OSErrorrGrYrgrJrsrrXrwr� SSLContext�boolryrM� BaseException� __reduce__� __classcell__�ros@r3rr�s!��������� /�}�/��/�D�/�/�/�/�/�/� ��'�����X���#�c�#�#�#��X�#��#�h�s�m�#�#�#��X�#��"�U�:�t�]�:�;�"�"�"��X�"� �� � � � � �)�J�J�J�J�Jr2rc��eZdZdZdS)rz�DNS resolution failed during client connection. Raised in :class:`aiohttp.connector.TCPConnector` if DNS resolution fails. Nr,r1r2r3rr�����������r2rc��eZdZdZdS)rz�Proxy connection error. Raised in :class:`aiohttp.connector.TCPConnector` if connection to proxy can not be established. Nr,r1r2r3rr�r�r2rc�\��eZdZdZdedededdf�fd� Zedefd���Z defd �Z �xZ S) �UnixClientConnectorErrorz�Unix connector error. Raised in :py:class:`aiohttp.connector.UnixConnector` if connection to unix socket can not be established. �pathrfrgr<Nc�Z��||_t���||��dSri)�_pathrlrG)rFr�rfrgros �r3rGz!UnixClientConnectorError.__init__�s,����� � �������2�2�2�2�2r2c��|jSri)r�rLs r3r�zUnixClientConnectorError.path�s ���z�r2c�Z�d�||jdurdn|j|j��S)Nz4Cannot connect to unix socket {0.path} ssl:{1} [{2}]Tr{r|rLs r3rMz UnixClientConnectorError.__str__�s5��E�L�L� �t�x�4�/�/�)�)�T�X�t�}� � � r2) r-r.r/r0rJr r}rGrYr�rMr�r�s@r3r�r��s���������� 3��3�)6�3�BI�3� �3�3�3�3�3�3� ��c�����X�� �� � � � � � � � r2r�c��eZdZdZdS)rzServer connection errors.Nr,r1r2r3rr��������#�#�#�#r2rc�6�eZdZdZddeeedfddfd�ZdS)rzServer disconnected.Nr8r<c�,�|�d}|f|_||_dS)NzServer disconnected)rEr8)rFr8s r3rGz ServerDisconnectedError.__init__s �� �?�+�G��J�� ��� � � r2ri)r-r.r/r0rrrJrGr1r2r3rrsO�����������&8�#�t�&C� D��PT������r2rc��eZdZdZdS)rzServer timeout error.Nr,r1r2r3rr ����������r2rc��eZdZdZdS)rzConnection timeout error.Nr,r1r2r3rrr�r2rc��eZdZdZdS)rzSocket timeout error.Nr,r1r2r3rrr�r2rc �:�eZdZdZdededededdf d�Zdefd �ZdS) rz4SSL certificate does not match expected fingerprint.�expected�gotrsrwr<Nc�T�||_||_||_||_||||f|_dSri)r�r�rsrwrE)rFr�r�rsrws r3rGz"ServerFingerprintMismatch.__init__s2�� �� ������ ��� ��s�D�$�/�� � � r2c�p�d�|jj|j|j|j|j��S)Nz/<{} expected={!r} got={!r} host={!r} port={!r}>)rIror-r�r�rsrwrLs r3rRz"ServerFingerprintMismatch.__repr__#s2��@�G�G� �N� #�T�]�D�H�d�i��� � � r2) r-r.r/r0�bytesrJrXrGrRr1r2r3rrsl������>�>�0��0�U�0�#�0�S�0�T�0�0�0�0� �#� � � � � � r2rc��eZdZdZdS)r#zResponse payload error.Nr,r1r2r3r#r#)s������!�!�!�!r2r#c���eZdZdZd dedeedfddf�fd� Zedefd���Z ed d ���Z defd �Z defd �Z �xZ S)r$zbInvalid URL. URL used for fetching is malformed, e.g. it doesn't contains host part. N�url� descriptionr<c���||_||_|r$t���||��dSt���|��dSri)�_url� _descriptionrlrG)rFr�r�ros �r3rGzInvalidURL.__init__6sZ����� �'��� � "� �G�G� � �S�+� .� .� .� .� .� �G�G� � �S� !� !� !� !� !r2c��|jSri)r�rLs r3r�zInvalidURL.urlAs ���y�r2� str | Nonec��|jSri)r�rLs r3r�zInvalidURL.descriptionEs ��� � r2c�(�d|jj�d|�d�S)N�<� �>)ror-rLs r3rRzInvalidURL.__repr__Is ��4�4�>�*�4�4�T�4�4�4�4r2c�Z�|jr|j�d|j��St|j��S)Nz - )r�r�rJrLs r3rMzInvalidURL.__str__Ls4�� � � 8��i�7�7�D�$5�7�7� 7��4�9�~�~�r2ri)r<r�)r-r.r/r0r rrJrGrYr�r�rRrMr�r�s@r3r$r$-s���������� "� "�H� "�5��d��3C� "�t� "� "� "� "� "� "���X�����X���!�!�!��X�!�5�#�5�5�5�5����������r2r$c��eZdZdZdS)r%zInvalid URL client error.Nr,r1r2r3r%r%Rr�r2r%c��eZdZdZdS)r&zClient redirect error.Nr,r1r2r3r&r&Vs������ � � � r2r&c��eZdZdZdS)r'zNon http URL client error.Nr,r1r2r3r'r'Zs������$�$�$�$r2r'c��eZdZdZdS)r(z"Invalid URL redirect client error.Nr,r1r2r3r(r(^s������,�,�,�,r2r(c��eZdZdZdS)r)z#Non http URL redirect client error.Nr,r1r2r3r)r)bs������-�-�-�-r2r)c��eZdZdZdS)rzBase error for ssl.*Errors.Nr,r1r2r3rrfs������%�%�%�%r2rc��eZdZdZdS)rzResponse ssl error.Nr,r1r2r3rr~s���������r2rc��eZdZdZdededdfd�Zedefd���Zede fd���Z ede e fd ���Z edefd ���Zde fd �ZdS) rzResponse certificate error.rf�certificate_errorr<Nc�4�||_||_||f|_dSri)rj�_certificate_errorrE)rFrfr�s r3rGz(ClientConnectorCertificateError.__init__�s$��(���"3���#�%6�7�� � � r2c��|jSri)r�rLs r3r�z1ClientConnectorCertificateError.certificate_error�s ���&�&r2c��|jjSrirrrLs r3rsz$ClientConnectorCertificateError.host�rtr2c��|jjSrirvrLs r3rwz$ClientConnectorCertificateError.port�rtr2c��|jjSri)rj�is_sslrLs r3ryz#ClientConnectorCertificateError.ssl�s ���~�$�$r2c�,�d�|��S)Nz{Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} [{0.certificate_error.__class__.__name__}: {0.certificate_error.args}])rIrLs r3rMz'ClientConnectorCertificateError.__str__�s�� *�*0�&��,�,� r2)r-r.r/r0r � ExceptionrGrYr�rJrsrrXrwrryrMr1r2r3rr�s������%�%�8�+�8�@I�8� �8�8�8�8��'�9�'�'�'��X�'��#�c�#�#�#��X�#��#�h�s�m�#�#�#��X�#��%�T�%�%�%��X�%� �� � � � � � r2rc��eZdZdZdS)r*z$WebSocket message type is not valid.Nr,r1r2r3r*r*�rar2r*)Br0�asynciorB�typingrrrr� multidictr�typedefsr ryr~� ImportError� client_reqrepr r r r � http_parserr�__all__r�rrr"r!r r_rrcrr}rrrrr�rr� TimeoutErrorrrrrr#rAr$r%r&r'r(r)r�CertificateError� cert_errors�cert_errors_bases�SSLError� ssl_errors�ssl_error_bases�tuplerr� TypeErrorr*r1r2r3�<module>r�s�������������8�8�8�8�8�8�8�8�8�8�8�8�"�"�"�"�"�"��������  ��J�J�J���J�J� �� � � ��^� � �� � � � ����j�j�j� �����M�V�V�V�V�V�V�V�V�V�V�V�V�/�/�/�/�/�/�/�HL�L�K�L�.�L�=�3E� ��@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�/�/�/������!6�8L���������)�7����#*�#*�#*�#*�#*�=�#*�#*�#*�L�����2���������!5���� � � � � �3� � � �.$�$�$�$�$�1�$�$�$������3���� � � � � �.��0D� � � �$�$�$�$�$�/�$�$�$� � � � � �+� � � �  �  �  �  �  � 5�  �  �  � "�"�"�"�"��"�"�"�"�"�"�"�"��j�"�"�"�J$�$�$�$�$�J�$�$�$�!�!�!�!�!�+�!�!�!�%�%�%�%�%�K�%�%�%�-�-�-�-�-�$9�;N�-�-�-�.�.�.�.�.�$9�;N�.�.�.�&�&�&�&�&�)�&�&�&��?��'�)�K�� ���� �,��J�%�s�|�4�O�O��%�'�'�K����� ����J�%�'�O������������ � � � � � �'8� � � � �D/�/�/�/�/��/�/�/�/�/s� >� A � A 
Memory