
    Ng                        d Z ddl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          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dS )!z@
h2/exceptions
~~~~~~~~~~~~~

Exceptions for the HTTP/2 module.
    Nc                       e Zd ZdZdS )H2ErrorzB
    The base class for all exceptions for the HTTP/2 module.
    N__name__
__module____qualname____doc__     I/var/www/html/ai-engine/env/lib/python3.11/site-packages/h2/exceptions.pyr   r      s           r   r   c                   4    e Zd ZdZej        j        j        ZdS )ProtocolErrorzF
    An action was attempted in violation of the HTTP/2 protocol.
    N)	r   r   r   r	   h2errors
ErrorCodesPROTOCOL_ERROR
error_coder
   r   r   r   r      s'          %4JJJr   r   c                   4    e Zd ZdZej        j        j        ZdS )FrameTooLargeErrorzL
    The frame that we tried to send or that we received was too large.
    N	r   r   r   r	   r   r   r   FRAME_SIZE_ERRORr   r
   r   r   r   r      s'          %6JJJr   r   c                   4    e Zd ZdZej        j        j        ZdS )FrameDataMissingErrorzW
    The frame that we received is missing some data.

    .. versionadded:: 2.0.0
    Nr   r
   r   r   r   r   !   s'          %6JJJr   r   c                       e Zd ZdZdS )TooManyStreamsErrorzb
    An attempt was made to open a stream that would lead to too many concurrent
    streams.
    Nr   r
   r   r   r   r   +   s          	Dr   r   c                   4    e Zd ZdZej        j        j        ZdS )FlowControlErrorz@
    An attempted action violates flow control constraints.
    N)	r   r   r   r	   r   r   r   FLOW_CONTROL_ERRORr   r
   r   r   r   r   3   s'          %8JJJr   r   c                       e Zd ZdZd Zd ZdS )StreamIDTooLowErrorz
    An attempt was made to open a stream that had an ID that is lower than the
    highest ID we have seen on this connection.
    c                 "    || _         || _        d S N	stream_idmax_stream_id)selfr$   r%   s      r   __init__zStreamIDTooLowError.__init__@   s    " +r   c                 $    d| j         | j        fz  S )Nz(StreamIDTooLowError: %d is lower than %dr#   r&   s    r   __str__zStreamIDTooLowError.__str__G   s    9ND.=
 
 	
r   Nr   r   r   r	   r'   r*   r
   r   r   r    r    ;   s<         + + +
 
 
 
 
r   r    c                       e Zd ZdZdS )NoAvailableStreamIDErrorz
    There are no available stream IDs left to the connection. All stream IDs
    have been exhausted.

    .. versionadded:: 2.0.0
    Nr   r
   r   r   r-   r-   M   s          	Dr   r-   c                       e Zd ZdZd ZdS )NoSuchStreamErrorz
    A stream-specific action referenced a stream that does not exist.

    .. versionchanged:: 2.0.0
       Became a subclass of :class:`ProtocolError
       <h2.exceptions.ProtocolError>`
    c                     || _         d S r"   )r$   r&   r$   s     r   r'   zNoSuchStreamError.__init___   s    "r   Nr   r   r   r	   r'   r
   r   r   r/   r/   W   s-         # # # # #r   r/   c                       e Zd ZdZd ZdS )StreamClosedErrorz
    A more specific form of
    :class:`NoSuchStreamError <h2.exceptions.NoSuchStreamError>`. Indicates
    that the stream has since been closed, and that all state relating to that
    stream has been removed.
    c                 X    || _         t          j        j        j        | _        g | _        d S r"   )r$   r   r   r   STREAM_CLOSEDr   _eventsr1   s     r   r'   zStreamClosedError.__init__k   s'    " ).< r   Nr2   r
   r   r   r4   r4   d   s-         	 	 	 	 	r   r4   c                   "     e Zd ZdZ fdZ xZS )InvalidSettingsValueErrorz\
    An attempt was made to set an invalid Settings value.

    .. versionadded:: 2.0.0
    c                 f    t          t          |                               |           || _        d S r"   )superr9   r'   r   )r&   msgr   	__class__s      r   r'   z"InvalidSettingsValueError.__init__}   s-    '..77<<<$r   )r   r   r   r	   r'   __classcell__)r=   s   @r   r9   r9   w   sB         
% % % % % % % % %r   r9   c                       e Zd ZdZd Zd ZdS )InvalidBodyLengthErrorz{
    The remote peer sent more or less data that the Content-Length header
    indicated.

    .. versionadded:: 2.0.0
    c                 "    || _         || _        d S r"   expected_lengthactual_length)r&   expectedactuals      r   r'   zInvalidBodyLengthError.__init__   s    '#r   c                 $    d| j         | j        fz  S )Nz6InvalidBodyLengthError: Expected %d bytes, received %drB   r)   s    r   r*   zInvalidBodyLengthError.__str__   s     G $"4K
 
 	
r   Nr+   r
   r   r   r@   r@      s<         $ $ $
 
 
 
 
r   r@   c                       e Zd ZdZdS )UnsupportedFrameErrorz
    The remote peer sent a frame that is unsupported in this context.

    .. versionadded:: 2.1.0

    .. versionchanged:: 4.0.0
       Removed deprecated KeyError parent class.
    Nr   r
   r   r   rI   rI      s          	Dr   rI   c                       e Zd ZdZdS )RFC1122Errora  
    Emitted when users attempt to do something that is literally allowed by the
    relevant RFC, but is sufficiently ill-defined that it's unwise to allow
    users to actually do it.

    While there is some disagreement about whether or not we should be liberal
    in what accept, it is a truth universally acknowledged that we should be
    conservative in what emit.

    .. versionadded:: 2.4.0
    Nr   r
   r   r   rK   rK      s        
 
 	Dr   rK   c                   4    e Zd ZdZej        j        j        ZdS )DenialOfServiceErrora@  
    Emitted when the remote peer exhibits a behaviour that is likely to be an
    attempt to perform a Denial of Service attack on the implementation. This
    is a form of ProtocolError that carries a different error code, and allows
    more easy detection of this kind of behaviour.

    .. versionadded:: 2.5.0
    N)	r   r   r   r	   r   r   r   ENHANCE_YOUR_CALMr   r
   r   r   rM   rM      s'          %7JJJr   rM   )r	   	h2.errorsr   	Exceptionr   r   r   r   r   r   r    r-   r/   r4   
ValueErrorr9   r@   rI   rK   rM   r
   r   r   <module>rR      s           i   5 5 5 5 5G 5 5 57 7 7 7 7 7 7 77 7 7 7 7M 7 7 7	 	 	 	 	- 	 	 	9 9 9 9 9} 9 9 9
 
 
 
 
- 
 
 
$	 	 	 	 	} 	 	 	
# 
# 
# 
# 
# 
# 
# 
#    )   &% % % % %z % % %
 
 
 
 
] 
 
 
"		 		 		 		 		M 		 		 			 	 	 	 	7 	 	 	"8 8 8 8 8= 8 8 8 8 8r   