Coverage for fss\common\exception\exception.py: 50%
6 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-11 19:09 +0800
« prev ^ index » next coverage.py v7.4.4, created at 2024-04-11 19:09 +0800
1"""The exceptions used in the project"""
3import http
6class ServiceException(Exception):
7 def __init__(self, code: int, msg: str, status_code: int = http.HTTPStatus.OK):
8 """
9 Base service exception
10 :param code: error code
11 :param msg: error message
12 :param status_code: http status code
13 """
14 self.code = code
15 self.msg = msg
16 self.status_code = status_code