exceptions.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # -*- coding: utf-8 -*-
  2. class TokenException(Exception):
  3. def __init__(self):
  4. super().__init__()
  5. class AuthException(Exception):
  6. def __init__(self, errmsg: str):
  7. super().__init__()
  8. self.errmsg = errmsg
  9. class ParamException(Exception):
  10. def __init__(self, param: str):
  11. super().__init__()
  12. self.param = param
  13. class Common404Exception(Exception):
  14. def __init__(self):
  15. super().__init__()
  16. class AppException(Exception):
  17. def __init__(self, code: int, msg: str):
  18. super().__init__()
  19. self.code = code
  20. self.msg = msg
  21. class AlertException(Exception):
  22. def __init__(self, ret: int, msg: str):
  23. super().__init__()
  24. self.ret = ret
  25. self.msg = msg
  26. class XssException(Exception):
  27. def __init__(self):
  28. super().__init__()
  29. class YzyException(Exception):
  30. def __init__(self, errcode: int, errmsg: str):
  31. super().__init__()
  32. self.errcode = errcode
  33. self.errmsg = errmsg
  34. class RoleException(Exception):
  35. def __init__(self, errcode: int, errmsg: str):
  36. super().__init__(f"Error {errcode}: {errmsg}")
  37. self.errcode = errcode
  38. self.errmsg = errmsg
  39. class HmacException(Exception):
  40. def __init__(self, code: int, msg: str):
  41. super().__init__()
  42. self.code = code
  43. self.msg = msg