o
    /h                     @  s  d Z ddl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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d#S )$z@
h2/exceptions
~~~~~~~~~~~~~

Exceptions for the HTTP/2 module.
    )annotations   )
ErrorCodesc                   @     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__ r   r   F/var/www/html/govbot/env/lib/python3.10/site-packages/h2/exceptions.pyr          r   c                   @     e Zd ZdZejZdS )ProtocolErrorzF
    An action was attempted in violation of the HTTP/2 protocol.
    N)r   r	   r
   r   r   PROTOCOL_ERROR
error_coder   r   r   r   r          
r   c                   @  r   )FrameTooLargeErrorzL
    The frame that we tried to send or that we received was too large.
    Nr   r	   r
   r   r   FRAME_SIZE_ERRORr   r   r   r   r   r      r   r   c                   @  r   )FrameDataMissingErrorzW
    The frame that we received is missing some data.

    .. versionadded:: 2.0.0
    Nr   r   r   r   r   r   $   s    
r   c                   @  r   )TooManyStreamsErrorzb
    An attempt was made to open a stream that would lead to too many concurrent
    streams.
    Nr   r   r   r   r   r   /   r   r   c                   @  r   )FlowControlErrorz@
    An attempted action violates flow control constraints.
    N)r   r	   r
   r   r   FLOW_CONTROL_ERRORr   r   r   r   r   r   7   r   r   c                   @  $   e Zd ZdZdddZdd
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.
    	stream_idintmax_stream_idreturnNonec                 C     || _ || _d S Nr   r   )selfr   r   r   r   r   __init__F   s   
zStreamIDTooLowError.__init__strc                 C     d| j  d| j S )NzStreamIDTooLowError: z is lower than r$   r%   r   r   r   __str__M      zStreamIDTooLowError.__str__N)r   r   r   r   r    r!   r    r'   r   r	   r
   r   r&   r*   r   r   r   r   r   @   s    
r   c                   @  r   )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.   Q   r   r.   c                   @     e Zd ZdZd	d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>`
    r   r   r    r!   c                 C  s
   || _ d S r#   )r   r%   r   r   r   r   r&   d   s   
zNoSuchStreamError.__init__Nr   r   r    r!   r   r	   r
   r   r&   r   r   r   r   r0   [   s    r0   c                   @  r/   )
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.
    r   r   r    r!   c                 C  s   || _ tj| _g | _d S r#   )r   r   STREAM_CLOSEDr   _eventsr1   r   r   r   r&   q   s   
zStreamClosedError.__init__Nr2   r3   r   r   r   r   r4   i   s    r4   c                      s"   e Zd ZdZd
 fdd	Z  ZS )InvalidSettingsValueErrorz\
    An attempt was made to set an invalid Settings value.

    .. versionadded:: 2.0.0
    msgr'   r   r   r    r!   c                   s   t  | || _d S r#   )superr&   r   )r%   r8   r   	__class__r   r   r&      s   
z"InvalidSettingsValueError.__init__)r8   r'   r   r   r    r!   )r   r	   r
   r   r&   __classcell__r   r   r:   r   r7   }   s    r7   c                   @  r   )InvalidBodyLengthErrorz{
    The remote peer sent more or less data that the Content-Length header
    indicated.

    .. versionadded:: 2.0.0
    expectedr   actualr    r!   c                 C  r"   r#   expected_lengthactual_length)r%   r>   r?   r   r   r   r&      s   
zInvalidBodyLengthError.__init__r'   c                 C  r(   )Nz!InvalidBodyLengthError: Expected z bytes, received r@   r)   r   r   r   r*      r+   zInvalidBodyLengthError.__str__N)r>   r   r?   r   r    r!   r,   r-   r   r   r   r   r=      s    
r=   c                   @  r   )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   r   rC      r   rC   c                   @  r   )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   r   rD      r   rD   c                   @  r   )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   ENHANCE_YOUR_CALMr   r   r   r   r   rE      s    
rE   N)r   
__future__r   errorsr   	Exceptionr   r   r   r   r   r   r   r.   r0   r4   
ValueErrorr7   r=   rC   rD   rE   r   r   r   r   <module>   s$    			
