chat_back/app/chat/exceptions.py
2024-06-12 20:02:55 +05:00

43 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from fastapi import status
from app.exceptions import BlackPhoenixException
class UseWSException(BlackPhoenixException):
status_code = status.HTTP_403_FORBIDDEN
detail = "Це для теста, не трожь сцука!!!"
class UserDontHavePermissionException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "У вас нет прав для этого действия"
class MessageNotFoundException(BlackPhoenixException):
status_code = status.HTTP_404_NOT_FOUND
detail = "Сообщение не найдено"
class UserCanNotReadThisChatException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "Юзер не может читать этот чат"
class UserAlreadyInChatException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "Юзер уже добавлен в чат"
class UserAlreadyPinnedChatException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "Юзер уже закрепил чат"
class MessageAlreadyPinnedException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "Сообщение уже закрепили"
class ChatNotFoundException(BlackPhoenixException):
status_code = status.HTTP_409_CONFLICT
detail = "Чат не найден"