exception.py 722 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 CaptchaExpireException(AcceptedException):
  19. description = 'Captcha Expire Status'