exception.py 774 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- coding: utf-8 -*-
  2. # @Author : YY
  3. # todo: 完善异常类
  4. from werkzeug.exceptions import HTTPException
  5. class CreatedException(HTTPException):
  6. code = 201
  7. description = 'Request Create Status'
  8. class AcceptedException(HTTPException):
  9. code = 202
  10. description = 'Request Accept Status'
  11. class NoContentException(HTTPException):
  12. code = 204
  13. description = 'Request No Content Status'
  14. class ServiceException(AcceptedException):
  15. description = 'Service Accept Status'
  16. class CaptchaException(AcceptedException):
  17. description = 'Captcha Accept Status'
  18. class NotContentException(AcceptedException):
  19. description = 'Not Content Accept Status'
  20. class CaptchaExpireException(AcceptedException):
  21. description = 'Captcha Expire Status'