2026-05-22 13:44:50 +08:00
|
|
|
|
"""评测 API 领域异常(继承 AppError,由全局 handler 统一映射)。"""
|
2026-04-03 14:44:46 +08:00
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
from app.core.errors import BadRequestError, NotFoundError
|
2026-04-03 14:44:46 +08:00
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
|
|
|
|
|
|
class EvaluationNotFoundError(NotFoundError):
|
2026-04-03 14:44:46 +08:00
|
|
|
|
def __init__(self, detail: str = "not found") -> None:
|
|
|
|
|
|
super().__init__(detail)
|
|
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
@property
|
|
|
|
|
|
def detail(self) -> str:
|
|
|
|
|
|
return self.message
|
|
|
|
|
|
|
2026-04-03 14:44:46 +08:00
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
class EvaluationBadRequestError(BadRequestError):
|
2026-04-03 14:44:46 +08:00
|
|
|
|
def __init__(self, detail: str) -> None:
|
|
|
|
|
|
super().__init__(detail)
|
2026-05-22 13:44:50 +08:00
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
def detail(self) -> str:
|
|
|
|
|
|
return self.message
|