
    %g                    l   S r SSKJr  SSKJr   " S S\5      r " S S\5      r " S	 S
\5      r " S S\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      rg#)$z@
h2/exceptions
~~~~~~~~~~~~~

Exceptions for the HTTP/2 module.
    )annotations   )
ErrorCodesc                      \ rS rSrSrSrg)H2Error   z:
The base class for all exceptions for the HTTP/2 module.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r	       //usr/lib/python3/dist-packages/h2/exceptions.pyr   r      s    r   r   c                  0    \ rS rSrSr\R                  rSrg)ProtocolError   z>
An action was attempted in violation of the HTTP/2 protocol.
r	   N)	r   r   r   r   r   r   PROTOCOL_ERROR
error_coder   r	   r   r   r   r      s    
 **Jr   r   c                  0    \ rS rSrSr\R                  rSrg)FrameTooLargeError   zD
The frame that we tried to send or that we received was too large.
r	   N	r   r   r   r   r   r   FRAME_SIZE_ERRORr   r   r	   r   r   r   r      s    
 ,,Jr   r   c                  0    \ rS rSrSr\R                  rSrg)FrameDataMissingError$   zK
The frame that we received is missing some data.

.. versionadded:: 2.0.0
r	   Nr   r	   r   r   r   r   $   s     ,,Jr   r   c                      \ rS rSrSrSrg)TooManyStreamsError/   zV
An attempt was made to open a stream that would lead to too many concurrent
streams.
r	   Nr
   r	   r   r   r!   r!   /   s    r   r!   c                  0    \ rS rSrSr\R                  rSrg)FlowControlError7   z8
An attempted action violates flow control constraints.
r	   N)	r   r   r   r   r   r   FLOW_CONTROL_ERRORr   r   r	   r   r   r$   r$   7   s    
 ..Jr   r$   c                  ,    \ rS rSrSrSS jrSS jrSrg)	StreamIDTooLowError@   zx
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                    Xl         X l        g N	stream_idmax_stream_id)selfr-   r.   s      r   __init__StreamIDTooLowError.__init__F   s    " +r   c                :    SU R                    SU R                   3$ )NzStreamIDTooLowError: z is lower than r,   r/   s    r   __str__StreamIDTooLowError.__str__M   s!    &t~~&6odFXFXEYZZr   )r.   r-   N)r-   intr.   r6   returnNoner7   strr   r   r   r   r   r0   r4   r   r	   r   r   r(   r(   @   s    
+[r   r(   c                      \ rS rSrSrSrg)NoAvailableStreamIDErrorQ   zx
There are no available stream IDs left to the connection. All stream IDs
have been exhausted.

.. versionadded:: 2.0.0
r	   Nr
   r	   r   r   r=   r=   Q   s    r   r=   c                  "    \ rS rSrSrSS jrSrg)NoSuchStreamError[   z
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                    Xl         g r+   r-   r/   r-   s     r   r0   NoSuchStreamError.__init__d   s    "r   rC   Nr-   r6   r7   r8   r   r   r   r   r   r0   r   r	   r   r   r@   r@   [   s    #r   r@   c                  "    \ rS rSrSrSS jrSrg)StreamClosedErrori   z
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                H    Xl         [        R                  U l        / U l        g r+   )r-   r   STREAM_CLOSEDr   _eventsrD   s     r   r0   StreamClosedError.__init__q   s    " %22 r   )rM   r   r-   NrF   rG   r	   r   r   rI   rI   i   s    	r   rI   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )InvalidSettingsValueError}   zP
An attempt was made to set an invalid Settings value.

.. versionadded:: 2.0.0
c                0   > [         TU ]  U5        X l        g r+   )superr0   r   )r/   msgr   	__class__s      r   r0   "InvalidSettingsValueError.__init__   s    $r   )r   )rT   r:   r   r   r7   r8   )r   r   r   r   r   r0   r   __classcell__)rU   s   @r   rP   rP   }   s    % %r   rP   c                  ,    \ rS rSrSrSS jrSS jrSrg)	InvalidBodyLengthError   zk
The remote peer sent more or less data that the Content-Length header
indicated.

.. versionadded:: 2.0.0
c                    Xl         X l        g r+   expected_lengthactual_length)r/   expectedactuals      r   r0   InvalidBodyLengthError.__init__   s    '#r   c                :    SU R                    SU R                   3$ )Nz!InvalidBodyLengthError: Expected z bytes, received r\   r3   s    r   r4   InvalidBodyLengthError.__str__   s%    243G3G2HHYZ^ZlZlYmnnr   )r^   r]   N)r_   r6   r`   r6   r7   r8   r9   r;   r	   r   r   rY   rY      s    $or   rY   c                      \ rS rSrSrSrg)UnsupportedFrameError   z
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.
r	   Nr
   r	   r   r   re   re      s    r   re   c                      \ rS rSrSrSrg)RFC1122Error   aw  
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
r	   Nr
   r	   r   r   rh   rh      s    
r   rh   c                  0    \ rS rSrSr\R                  rSrg)DenialOfServiceError   a(  
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
r	   N)	r   r   r   r   r   r   ENHANCE_YOUR_CALMr   r   r	   r   r   rk   rk      s     --Jr   rk   N)r   
__future__r   errorsr   	Exceptionr   r   r   r   r!   r$   r(   r=   r@   rI   
ValueErrorrP   rY   re   rh   rk   r	   r   r   <module>rr      s    # i +G +- --M -- /} /[- ["} # #) (	%z 	%o] o M 7 ".= .r   