ruler_validation_exception.py 713 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. # @Time : 2023/7/21 15:15
  3. # @Author : XuJiakai
  4. # @File : ruler_validation_exception
  5. # @Software: PyCharm
  6. class RulerValidationException(Exception):
  7. def __init__(self, ruler_code, msg=None, ):
  8. """
  9. 业务逻辑规则校验,不符合数据业务逻辑的,将抛出此异常
  10. :param ruler_code:
  11. :param msg:
  12. """
  13. self.ruler_code = ruler_code
  14. self.msg = msg
  15. pass
  16. def __str__(self):
  17. return f"数据校验异常,ruler_code: {self.ruler_code} , msg : {self.msg}"
  18. def get_ruler_code(self):
  19. return self.ruler_code
  20. def get_msg(self):
  21. return self.msg
  22. if __name__ == '__main__':
  23. pass