execptions.py 546 B

12345678910111213141516171819
  1. class JyException(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 VerifyException(JyException):
  9. def __init__(self, code: int = 10001, 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)