
    AҐi                        d Z  G d d      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      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'Zy())z^
HTTP/2 specific exceptions.

These exceptions map to HTTP/2 error codes defined in RFC 7540.
c                   H    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZy)HTTP2ErrorCodez(HTTP/2 Error Codes (RFC 7540 Section 7).                            	   
            N)__name__
__module____qualname____doc__NO_ERRORPROTOCOL_ERRORINTERNAL_ERRORFLOW_CONTROL_ERRORSETTINGS_TIMEOUTSTREAM_CLOSEDFRAME_SIZE_ERRORREFUSED_STREAMCANCELCOMPRESSION_ERRORCONNECT_ERRORENHANCE_YOUR_CALMINADEQUATE_SECURITYHTTP_1_1_REQUIRED     N/var/www/descvideos/venv/lib/python3.12/site-packages/gunicorn/http2/errors.pyr   r      sR    2HNNMNFMr%   r   c                   (     e Zd ZdZdZd fd	Z xZS )
HTTP2Errorz!Base exception for HTTP/2 errors.r   c                     |xs | j                   j                  | _        ||| _        t        |   | j                         y N)	__class__r   message
error_codesuper__init__)selfr,   r-   r+   s      r&   r/   zHTTP2Error.__init__%   s7    8$.."8"8!(DO&r%   NN)r   r   r   r   r-   r/   __classcell__r+   s   @r&   r(   r(       s    +J' 'r%   r(   c                       e Zd ZdZdZy)HTTP2ProtocolErrorzProtocol error detected.r   Nr   r   r   r   r-   r$   r%   r&   r5   r5   ,   
    "Jr%   r5   c                       e Zd ZdZdZy)HTTP2InternalErrorzInternal error occurred.r   Nr6   r$   r%   r&   r9   r9   2   r7   r%   r9   c                       e Zd ZdZdZy)HTTP2FlowControlErrorzFlow control limits exceeded.r   Nr6   r$   r%   r&   r;   r;   8   s
    'Jr%   r;   c                       e Zd ZdZdZy)HTTP2SettingsTimeoutz Settings acknowledgment timeout.r   Nr6   r$   r%   r&   r=   r=   >   
    *Jr%   r=   c                       e Zd ZdZdZy)HTTP2StreamClosedzStream was closed.r	   Nr6   r$   r%   r&   r@   r@   D   s
    Jr%   r@   c                       e Zd ZdZdZy)HTTP2FrameSizeErrorzFrame size is incorrect.r
   Nr6   r$   r%   r&   rB   rB   J   r7   r%   rB   c                       e Zd ZdZdZy)HTTP2RefusedStreamzStream was refused.r   Nr6   r$   r%   r&   rD   rD   P   s
    Jr%   rD   c                       e Zd ZdZdZy)HTTP2CancelzStream was cancelled.r   Nr6   r$   r%   r&   rF   rF   V   s
    Jr%   rF   c                       e Zd ZdZdZy)HTTP2CompressionErrorzCompression state error.r   Nr6   r$   r%   r&   rH   rH   \   r7   r%   rH   c                       e Zd ZdZdZy)HTTP2ConnectErrorz Connection error during CONNECT.r   Nr6   r$   r%   r&   rJ   rJ   b   r>   r%   rJ   c                       e Zd ZdZdZy)HTTP2EnhanceYourCalmz"Peer is generating excessive load.r   Nr6   r$   r%   r&   rL   rL   h   s
    ,Jr%   rL   c                       e Zd ZdZdZy)HTTP2InadequateSecurityz!Transport security is inadequate.r   Nr6   r$   r%   r&   rN   rN   n   s
    +Jr%   rN   c                       e Zd ZdZdZy)HTTP2RequiresHTTP11z&HTTP/1.1 is required for this request.r   Nr6   r$   r%   r&   rP   rP   t   s
    0Jr%   rP   c                   *     e Zd ZdZd fd	Zd Z xZS )HTTP2StreamErrorz"Error specific to a single stream.c                 4    || _         t        | 	  ||       y r*   )	stream_idr.   r/   )r0   rT   r,   r-   r+   s       r&   r/   zHTTP2StreamError.__init__}   s    "*-r%   c                 :    d| j                    d| j                   S )NzStream z: )rT   r,   )r0   s    r&   __str__zHTTP2StreamError.__str__   s    (4<<.99r%   r1   )r   r   r   r   r/   rV   r2   r3   s   @r&   rR   rR   z   s    ,.:r%   rR   c                       e Zd ZdZy)HTTP2ConnectionErrorz&Error affecting the entire connection.Nr   r   r   r   r$   r%   r&   rX   rX      s    0r%   rX   c                       e Zd ZdZy)HTTP2ConfigurationErrorzInvalid HTTP/2 configuration.NrY   r$   r%   r&   r[   r[      s    'r%   r[   c                   $     e Zd ZdZd fd	Z xZS )HTTP2NotAvailablez;HTTP/2 support is not available (h2 library not installed).c                 0    |xs d}t         |   |       y )Nz;HTTP/2 requires the h2 library: pip install gunicorn[http2])r.   r/   )r0   r,   r+   s     r&   r/   zHTTP2NotAvailable.__init__   s    ZZ!r%   r*   )r   r   r   r   r/   r2   r3   s   @r&   r]   r]      s    E" "r%   r]   )r   r(   r5   r9   r;   r=   r@   rB   rD   rF   rH   rJ   rL   rN   rP   rR   rX   r[   r]   N)r   r   	Exceptionr(   r5   r9   r;   r=   r@   rB   rD   rF   rH   rJ   rL   rN   rP   rR   rX   r[   r]   __all__r$   r%   r&   <module>ra      s    &	' 	'  J : 
 *  * J 
 : j * :z :1: 1(j ("
 "r%   