You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iTi-Flask/iti/common/exceptions/biz_exp.py

18 lines
531 B
Python

from iti.exceptions import BizError
class BizException(BizError):
def __init__(self, message: str = "操作失败", code: int = 500, data=None):
self.message = message
self.code = code
self.data = data
def __str__(self):
return f"{self.message} (code: {self.code}) (data: {self.data})"
def __repr__(self):
return f"{self.message} (code: {self.code}) (data: {self.data})"
def __dict__(self):
return {"message": self.message, "code": self.code, "data": self.data}