27 lines
627 B
Python
27 lines
627 B
Python
from rest_framework.exceptions import APIException
|
|
|
|
|
|
class UserIdNotExist(APIException):
|
|
status_code = 404
|
|
default_detail = "User ID does not exist"
|
|
|
|
|
|
class UserAlreadyExistInOrganization(APIException):
|
|
status_code = 403
|
|
default_detail = "User allready exist in the organization"
|
|
|
|
|
|
class OrganizationNotExist(APIException):
|
|
status_code = 404
|
|
default_detail = "Organization does not exist"
|
|
|
|
|
|
class UnknownException(APIException):
|
|
status_code = 500
|
|
default_detail = "An unexpected error occurred"
|
|
|
|
|
|
class BadRequestException(APIException):
|
|
status_code = 400
|
|
default_detail = "Bad Request"
|