24 lines
597 B
Python
24 lines
597 B
Python
from pkg.exceptions.constant import ParamErrorCode
|
||
|
||
|
||
class ParamErrorException(Exception):
|
||
"""
|
||
Param Error Custom Exception
|
||
"""
|
||
|
||
def __init__(self, status=None, message=""):
|
||
"""
|
||
:param status: error.status.code
|
||
:param message: error.status.message
|
||
"""
|
||
if status is None:
|
||
status = ParamErrorCode
|
||
super().__init__(message, status)
|
||
self.message = message
|
||
self.status = status
|
||
|
||
|
||
def __str__(self):
|
||
|
||
return f"【metric server error】status code is {self.status}, error message is {self.message}"
|