o
    U!h4                     @   s   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZ d dlmZmZ d	ed
e
defddZd	ed
edefddZded
eddfddZdS )    )jsonable_encoder)RequestValidationErrorWebSocketRequestValidationError)is_body_allowed_for_status_code)	WebSocket)HTTPException)Request)JSONResponseResponse)HTTP_422_UNPROCESSABLE_ENTITYWS_1008_POLICY_VIOLATIONrequestexcreturnc                    s<   t |dd }t|jst|j|dS td|ji|j|dS )Nheaders)status_coder   detail)getattrr   r   r
   r	   r   )r   r   r    r   /var/www/html/contec/backend/tec.wsc/Coding/backend/Contec_Project_backend/env/lib/python3.10/site-packages/fastapi/exception_handlers.pyhttp_exception_handler   s   
r   c                    s   t tdt| idS )Nr   )r   content)r	   r   r   errors)r   r   r   r   r   $request_validation_exception_handler   s
   r   	websocketNc                    s"   | j tt| dI d H  d S )N)codereason)closer   r   r   )r   r   r   r   r   .websocket_request_validation_exception_handler   s   r   )fastapi.encodersr   fastapi.exceptionsr   r   fastapi.utilsr   fastapi.websocketsr   starlette.exceptionsr   starlette.requestsr   starlette.responsesr	   r
   starlette.statusr   r   r   r   r   r   r   r   r   <module>   s.    	
	