exceptions.py 506 B

1234567891011121314
  1. from django.utils.translation import gettext_lazy as _
  2. from rest_framework import exceptions, status
  3. class ConflictException(exceptions.APIException):
  4. status_code = status.HTTP_409_CONFLICT
  5. default_detail = _("Already present!")
  6. default_code = "already_present"
  7. class ServiceUnavailableException(exceptions.APIException):
  8. status_code = status.HTTP_503_SERVICE_UNAVAILABLE
  9. default_detail = "Service temporarily unavailable, try again later."
  10. default_code = "service_unavailable"