Files
MangoTestingPlatform/MangoActuator/exceptions/__init__.py

20 lines
573 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
# @Project: MangoActuator
# @Description:
# @Time : 2023-07-07 10:14
# @Author : 毛鹏
from tools.log_collector import log
class MangoActuatorError(Exception):
def __init__(self, code: int, msg: str, value: tuple = None, error: any = None, is_log: bool = False):
if value:
msg = msg.format(*value)
if error and is_log:
log.error(f'报错提示:{msg} 报错内容:{error}')
elif is_log:
log.warning(f'报错提示:{msg}')
self.code = code
self.msg = msg