execptions.py 974 B

1234567891011121314151617181920212223242526272829303132333435
  1. class JyBasicException(Exception):
  2. def __init__(self, code: int, reason: str, **kwargs):
  3. self.code = code
  4. self.reason = reason
  5. self.err_details = kwargs
  6. for key, val in kwargs.items():
  7. setattr(self, key, val)
  8. class CustomCheckError(JyBasicException):
  9. def __init__(self, code: int = 10002, reason: str = '特征条件检查异常', **kwargs):
  10. self.code = code
  11. self.reason = reason
  12. self.err_details = kwargs
  13. for key, val in kwargs.items():
  14. setattr(self, key, val)
  15. class AttachmentNullError(JyBasicException):
  16. def __init__(self, code: int = 10004, reason: str = '附件下载异常', **kwargs):
  17. self.code = code
  18. self.reason = reason
  19. self.err_details = kwargs
  20. for key, val in kwargs.items():
  21. setattr(self, key, val)
  22. class CustomAccountPrivilegeError(JyBasicException):
  23. def __init__(self, *args, **kwargs):
  24. pass