o
    㥵i                     @   s6   d dl Z d dlmZ d dlmZmZ G dd dZdS )    N)
HTTPStatus)HTTPExceptionJSONResponsec                   @   s(   e Zd ZdefddZdefddZdS )ExceptionHandlerexcc                    s(   t t|j|jt|jjd|j|jS N)
statusCodemessageerror)r   dictstatus_codecontentr   phraseheaders)selfr    r   R/home/ubuntu/.local/lib/python3.10/site-packages/tools/server/exception_handler.pyhttp_exception_handler	   s   
z'ExceptionHandler.http_exception_handlerc                    s*   t   tj}tt|t||jd|S r   )	traceback	print_excr   INTERNAL_SERVER_ERRORr   r   strr   )r   r   statusr   r   r   other_exception_handler   s   z(ExceptionHandler.other_exception_handlerN)__name__
__module____qualname__r   r   	Exceptionr   r   r   r   r   r      s    r   )r   httpr   kui.asgir   r   r   r   r   r   r   <module>   s    