You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CustomerException.py 309B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. from loguru import logger
  3. """
  4. 自定义异常
  5. """
  6. class ServiceException(Exception):
  7. def __init__(self, code, msg):
  8. self.code = code
  9. self.msg = msg
  10. def __str__(self):
  11. logger.error("异常编码:{}, 异常描述:{}", self.code, self.msg)