metricscompute/pkg/exceptions/param_error_exception.py

24 lines
597 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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}"