Files
life-echo/api/app/features/evaluation/errors.py

22 lines
561 B
Python
Raw Normal View History

"""评测 API 领域异常(继承 AppError由全局 handler 统一映射)。"""
from app.core.errors import BadRequestError, NotFoundError
class EvaluationNotFoundError(NotFoundError):
def __init__(self, detail: str = "not found") -> None:
super().__init__(detail)
@property
def detail(self) -> str:
return self.message
class EvaluationBadRequestError(BadRequestError):
def __init__(self, detail: str) -> None:
super().__init__(detail)
@property
def detail(self) -> str:
return self.message