
    !Yw`
                        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	d Z
eeeeeee	fZdS )    Nc                   ^     e Zd Zd fd	Zd Zd Zd Zed             Ze	d             Z
 xZS )	JsonRpcExceptionNc                     t                                          |           |pt          | j        d          | _        |pt          | j        d          | _        || _        d S )NMESSAGECODE)super__init__getattr	__class__messagecodedataselfr   r   r   r   s       8lib/python3.11/site-packages/pylsp_jsonrpc/exceptions.pyr	   zJsonRpcException.__init__	   sV    !!!D'$.)"D"D;GDNF;;				    c                 F    | j         | j        d}| j        
| j        |d<   |S )N)r   r   r   )r   r   r   )r   exception_dicts     r   to_dictzJsonRpcException.to_dict   s4    I|
 
 9 %)YN6"r   c                 l    t          || j                  o| j        |j        k    o| j        |j        k    S N)
isinstancer   r   r   )r   others     r   __eq__zJsonRpcException.__eq__   s8    udn-- *I#*LEM)	
r   c                 8    t          | j        | j        f          S r   )hashr   r   )r   s    r   __hash__zJsonRpcException.__hash__   s    TY-...r   c                 x    t           D ]'}|                    | d                   r
 |di | c S (t          di | S )Nr    )_EXCEPTIONSsupports_coder   )error	exc_classs     r   	from_dictzJsonRpcException.from_dict"   s`    $ 	* 	*I&&uV}55 * y))5)))))*((%(((r   c                 ,    t          | dd          |k    S )Nr   i)r
   clsr   s     r   r!   zJsonRpcException.supports_code)   s     sFF++t33r   )NNN)__name__
__module____qualname__r	   r   r   r   staticmethodr$   classmethodr!   __classcell__r   s   @r   r   r      s               
 
 
/ / / ) ) \) 4 4 [4 4 4 4 4r   r   c                       e Zd ZdZdZdS )JsonRpcParseErroriDzParse ErrorNr(   r)   r*   r   r   r   r   r   r0   r0   /   s        DGGGr   r0   c                       e Zd ZdZdZdS )JsonRpcInvalidRequestizInvalid RequestNr1   r   r   r   r3   r3   4   s        DGGGr   r3   c                   ,    e Zd ZdZdZed             ZdS )JsonRpcMethodNotFoundizMethod Not Foundc                 0     | | j         dz   |z             S )Nz: )r   )r   )r'   methods     r   ofzJsonRpcMethodNotFound.of=   s!    s3;-67777r   Nr(   r)   r*   r   r   r,   r8   r   r   r   r5   r5   9   s7        D G8 8 [8 8 8r   r5   c                       e Zd ZdZdZdS )JsonRpcInvalidParams馀zInvalid ParamsNr1   r   r   r   r;   r;   B   s        DGGGr   r;   c                   ,    e Zd ZdZdZed             ZdS )JsonRpcInternalErrorr<   zInternal Errorc                     |\  }}} | d                     t          j        ||                                                    dt          j        |          i          S )N 	traceback)r   r   )joinrA   format_exception_onlystrip	format_tb)r'   exc_infoexc_type	exc_valueexc_tbs        r   r8   zJsonRpcInternalError.ofK   sb    &.#)VsGGI;HiPPQQWWYYy26::;
 
 
 	
r   Nr9   r   r   r   r>   r>   G   s7        DG
 
 [
 
 
r   r>   c                       e Zd ZdZdZdS )JsonRpcRequestCancelledizRequest CancelledNr1   r   r   r   rK   rK   T   s        D!GGGr   rK   c                   6     e Zd Zd fd	Zed             Z xZS )JsonRpcServerErrorNc                 r    t          |          sJ t                                          |||           d S )N)r   r   r   )_is_server_error_coder   r	   r   s       r   r	   zJsonRpcServerError.__init__[   s<    $T*****t$?????r   c                      t          |          S r   )rO   r&   s     r   r!   z JsonRpcServerError.supports_code_   s    $T***r   r   )r(   r)   r*   r	   r,   r!   r-   r.   s   @r   rM   rM   Y   s^        @ @ @ @ @ @ + + [+ + + + +r   rM   c                 "    d| cxk    odk    nc S )Nii r   )r   s    r   rO   rO   d   s$    T####V#####r   )rA   	Exceptionr   r0   r3   r5   r;   r>   rK   rM   rO   r    r   r   r   <module>rS      s      %4 %4 %4 %4 %4y %4 %4 %4P    (   
         ,      
8 8 8 8 8, 8 8 8    +   


 

 

 

 

+ 

 

 

" " " " ". " " "
+ + + + +) + + +$ $ $
 r   