execptions.py 973 B

123456789101112131415161718192021222324252627282930313233343536
  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 VoidCrawlError(JyBasicException):
  16. def __init__(self, code: int = 10003, 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