
    ,h                     z    d dl Z ddlmZ ddlmZmZmZ ddlm	Z	  G d de      Z
 G d d	e      Z G d
 de      Zy)    N   )datastructures)InvalidHandshakeInvalidMessageProtocolError)
StatusLikec                   D    e Zd ZdZdedej                  ddfdZdefdZ	y)InvalidStatusCodezC
    Raised when a handshake response status code is invalid.

    status_codeheadersreturnNc                      || _         || _        y N)r   r   )selfr   r   s      ^/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/websockets/legacy/exceptions.py__init__zInvalidStatusCode.__init__   s    &    c                      d| j                    S )Nz+server rejected WebSocket connection: HTTP )r   r   s    r   __str__zInvalidStatusCode.__str__   s    <T=M=M<NOOr   )
__name__
__module____qualname____doc__intr   Headersr   strr    r   r   r
   r
      s5    
C .2H2H T P Pr   r
   c            	       L    e Zd ZdZ	 d	dedej                  deddfdZde	fdZ
y)
AbortHandshakea  
    Raised to abort the handshake on purpose and return an HTTP response.

    This exception is an implementation detail.

    The public API is
    :meth:`~websockets.legacy.server.WebSocketServerProtocol.process_request`.

    Attributes:
        status (~http.HTTPStatus): HTTP status code.
        headers (Headers): HTTP response headers.
        body (bytes): HTTP response body.
    statusr   bodyr   Nc                 z    t        j                  |      | _        t        j                  |      | _        || _        y r   )http
HTTPStatusr!   r   r   r   r"   )r   r!   r   r"   s       r   r   zAbortHandshake.__init__*   s-     oof-%--g6	r   c                 |    d| j                   ddt        | j                         dt        | j                         dS )NzHTTP dz, z
 headers, z bytes)r!   lenr   r"   r   s    r   r   zAbortHandshake.__str__5   s9    DKK?"S%6$7z#dii.AQQWX	
r   )r   )r   r   r   r   r   r   HeadersLikebytesr   r   r   r   r   r   r    r       sI    $ 			  ++	 		
 
	
 
r   r    c                   ,    e Zd ZdZdeddfdZdefdZy)RedirectHandshakezd
    Raised when a handshake gets redirected.

    This exception is an implementation detail.

    urir   Nc                     || _         y r   r-   )r   r-   s     r   r   zRedirectHandshake.__init__C   s	    r   c                      d| j                    S )Nzredirect to r/   r   s    r   r   zRedirectHandshake.__str__F   s    dhhZ((r   )r   r   r   r   r   r   r   r   r   r   r,   r,   ;   s&    C D ) )r   r,   )r$    r   
exceptionsr   r   r   WebSocketProtocolErrortypingr   r
   r    r,   r   r   r   <module>r5      sD        P( P
% 
@)( )r   