o
    ñ;—i  ã                   @   sP   d dl mZmZ ddlmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZd
S )é    )ÚOptionalÚAnyé   )ÚStatusc                	       s<   e Zd ZdZ		d	dedee deddf‡ fdd„Z‡  Z	S )
Ú	GRPCErrora`  Expected error, may be raised during RPC call

    There can be multiple origins of this error. It can be generated
    on the server-side and on the client-side. If this error originates from
    the server, on the wire this error is represented as ``grpc-status`` and
    ``grpc-message`` trailers. Possible values of the ``grpc-status`` trailer
    are described in the gRPC protocol definition. In ``grpclib`` these values
    are represented as :py:class:`~grpclib.const.Status` enum.

    Here are possible origins of this error:

      - you may raise this error to cancel current call on the server-side or
        return non-OK :py:class:`~grpclib.const.Status` using
        :py:meth:`~grpclib.server.Stream.send_trailing_metadata` method
        `(e.g. resource not found)`
      - server may return non-OK ``grpc-status`` in different failure
        conditions `(e.g. invalid request)`
      - client raises this error for non-OK ``grpc-status`` from the server
      - client may raise this error in different failure conditions
        `(e.g. server returned unsupported` ``:content-type`` `header)`

    NÚstatusÚmessageÚdetailsÚreturnc                    s&   t ƒ  |||¡ || _|| _|| _d S )N)ÚsuperÚ__init__r   r   r	   )Úselfr   r   r	   ©Ú	__class__© úF/home/ubuntu/.local/lib/python3.10/site-packages/grpclib/exceptions.pyr      s   
zGRPCError.__init__)NN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ústrr   r   Ú__classcell__r   r   r   r   r      s    üþýüûr   c                   @   ó   e Zd ZdZdS )ÚProtocolErrorz”Unexpected error, raised by ``grpclib`` when your code violates
    gRPC protocol

    This error means that you probably should fix your code.
    N©r   r   r   r   r   r   r   r   r   ,   ó    r   c                   @   r   )ÚStreamTerminatedErrorzÙUnexpected error, raised when we receive ``RST_STREAM`` frame from
    the other side

    This error means that the other side decided to forcefully cancel current
    call, probably because of a protocol error.
    Nr   r   r   r   r   r   4   r   r   N)	Útypingr   r   Úconstr   Ú	Exceptionr   r   r   r   r   r   r   Ú<module>   s
    &