
    9i                    D    d Z ddlmZ ddlZddlmZ  G d de      ZdgZy)z#Exceptions used in the auth system.    )annotationsN)Mappingc                  >    e Zd ZdZ	 	 	 d	 	 	 	 	 	 	 ddZddZddZy)	HTTPExceptiona  HTTP exception that you can raise to return a specific HTTP error response.

    Since this is defined in the auth module, we default to a 401 status code.

    Args:
        status_code: HTTP status code for the error. Defaults to 401 "Unauthorized".
        detail: Detailed error message. If `None`, uses a default
            message based on the status code.
        headers: Additional HTTP headers to include in the error response.

    Example:
        Default:
        ```python
        raise HTTPException()
        # HTTPException(status_code=401, detail='Unauthorized')
        ```

        Add headers:
        ```python
        raise HTTPException(headers={"X-Custom-Header": "Custom Value"})
        # HTTPException(status_code=401, detail='Unauthorized', headers={"WWW-Authenticate": "Bearer"})
        ```

        Custom error:
        ```python
        raise HTTPException(status_code=404, detail="Not found")
        ```
    Nc                p    |t        j                  |      j                  }|| _        || _        || _        y )N)http
HTTPStatusphrasestatus_codedetailheaders)selfr   r   r   s       g/var/www/html/backtest/airagagent/rag_env/lib/python3.12/site-packages/langgraph_sdk/auth/exceptions.py__init__zHTTPException.__init__'   s3     >__[188F&    c                8    | j                    d| j                   S )Nz: )r   r   )r   s    r   __str__zHTTPException.__str__3   s    ""#2dkk]33r   c                l    | j                   j                  }| d| j                  d| j                  dS )Nz(status_code=z	, detail=))	__class____name__r   r   )r   
class_names     r   __repr__zHTTPException.__repr__6   s6    ^^,,
]4+;+;*>iVWXXr   )i  NN)r   intr   z
str | Noner   zMapping[str, str] | NonereturnNone)r   str)r   
__module____qualname____doc__r   r   r    r   r   r   r   	   sH    > !,0	

 
 *	

 

4Yr   r   )	r    
__future__r   r   collections.abcr   	Exceptionr   __all__r!   r   r   <module>r&      s*    ) "  #/YI /Yd 
r   