o
    Ö"7hÑ  ã                   @   s    d dl mZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZdS )é    )Ústatusc                   @   s   e Zd ZdZejZdZdS )ÚBaseAPIExceptiona[  
    Base API exception from which all specific exceptions will inherit.
    The exception defines a `STATUS_CODE` attribute and a `RESPONSE_MESSAGE`
    Those attributes are used by `api_view()` decorator, to return a readable
    `JsonResponse()` with a valid message and status code, without having to catch
    exceptions inside the view.
    z An unknown server error occured.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚHTTP_500_INTERNAL_SERVER_ERRORÚSTATUS_CODEÚRESPONSE_MESSAGE© r   r   úp/var/www/epreuve.sigeris.cm/public_html/epreuve/venv/lib/python3.10/site-packages/django_rest/http/exceptions.pyr      s    r   c                   @   ó   e Zd ZejZdZdS )Ú
BadRequestzBad request.N)r   r   r   r   ÚHTTP_400_BAD_REQUESTr	   r
   r   r   r   r   r      ó    r   c                   @   r   )ÚNotAuthenticatedz>Unauthorized operation. Maybe forgot the authentication step ?N)r   r   r   r   ÚHTTP_401_UNAUTHORIZEDr	   r
   r   r   r   r   r      r   r   c                   @   r   )ÚPermissionDeniedz>Forbidden operation. Make sure you have the right permissions.N)r   r   r   r   ÚHTTP_403_FORBIDDENr	   r
   r   r   r   r   r      r   r   c                   @   r   )ÚNotFoundz$The requested resource is not found.N)r   r   r   r   ÚHTTP_404_NOT_FOUNDr	   r
   r   r   r   r   r   "   r   r   c                   @   r   )ÚMethodNotAllowedzHTTP Method not allowed.N)r   r   r   r   ÚHTTP_405_METHOD_NOT_ALLOWEDr	   r
   r   r   r   r   r   '   r   r   c                   @   r   )ÚUnsupportedMediaTypez:Unsupported Media Type. Check your request's Content-Type.N)r   r   r   r   ÚHTTP_415_UNSUPPORTED_MEDIA_TYPEr	   r
   r   r   r   r   r   ,   r   r   c                   @   s   e Zd ZdS )ÚInternalServerErrorN)r   r   r   r   r   r   r   r   1   s    r   c                   @   r   )ÚServiceUnavailablez%The requested service is unavailable.N)r   r   r   r   ÚHTTP_503_SERVICE_UNAVAILABLEr	   r
   r   r   r   r   r   5   r   r   N)Údjango_rest.httpr   Ú	Exceptionr   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   